summaryrefslogtreecommitdiffhomepage
path: root/UI.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-12 07:52:36 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-12 07:52:36 -0400
commitd813bbc0dc7357f23b647a3a05ef61067c53195f (patch)
tree0c15d3c0703bea3ffee48ac16347aef265a028fc /UI.hs
parentddb4e6839fa2d7b589159c661815f89c8bb08c5f (diff)
downloadkeysafe-d813bbc0dc7357f23b647a3a05ef61067c53195f.tar.gz
pluggable UI
using zenity for GUI in X
Diffstat (limited to 'UI.hs')
-rw-r--r--UI.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/UI.hs b/UI.hs
new file mode 100644
index 0000000..7e583cf
--- /dev/null
+++ b/UI.hs
@@ -0,0 +1,20 @@
+{- Copyright 2016 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU AGPL version 3 or higher.
+ -}
+
+module UI where
+
+import Types
+
+data UI = UI
+ { isAvailable :: IO Bool
+ , promptName :: Title -> Desc -> (Name -> Maybe Problem) -> IO (Maybe Name)
+ , promptPassword :: Title -> Desc -> (Password -> Maybe Problem) -> IO (Maybe Password)
+ , withProgress :: Title -> Desc -> ((Percent -> IO ()) -> IO ()) -> IO ()
+ }
+
+type Title = String
+type Desc = String
+type Percent = Int
+type Problem = String