User interface library ====================== Possible targets * Desktop app (GTK, QT, Win32, ...)? * CLI * Voice * Configuration file / Macro etc. * Mobile app * Tablet app * Web (desktop/mobile/tablet) UI "areas": * Action with input (e.g. "Add contact") - Can have multiple steps or groups (targets with small screens might represent an action with steps, while desktop targets might - There can be different levels of grouping, for example ((username),(password,repeat,save-pwd)),(other-field-1,...) - Standard actions like "Search" (there can be target specific ways of accessing standard actions) - Actions can have different types of "windows": - "Search" might be just a small one line entry. - "Add contact" might be a "wizard" - "Settings" might be a tabbed dialog on desktop, or a menu hierarchy on mobile. - Actions may not always be applicable * Main task with "view areas" - On mobile, only the main one might be visible (others need to be swiped in, or accessed via a menu) - On desktop, non-main views might be sidebars etc. - Some extra views may be target specific - There can also be multiple tabs. * Mode-sensitive view areas. Examples: - Inbox -> View message -> Reply - Calendar month view -> Day view -> Add item ui: - tasks: - main view: - tabs - extra views - actions: - steps/groups: - inputs Examples of UIs --------------- UI type Main view Tabbed Extra views Actions (excl. Settings) --------------------------------------------------------------------------- Text editor Text Yes File list Search, Replace, Go to line, Open, Save as Terminal Console Yes - Search Calculator Calculator No Extra operators Plot graph, Unit conversion Mail client Mail list No Folders Search, New message, Reply, Forward Read e-mail Text No Recip., Attactm Add contact Write e-mail Text No Recip., Attachm Attach, Search/add recipient Chat Messages No Channel list Search message, Add contact, Send file/photo Web browser Web page Yes Tabs, Bookmarks Search/enter URL, Search on page, Bookmark Calendar Calendar No - Add, Search, Import, Export Backend stuff ------------- Actions have two phases: * Requesting input * Operating "Requesting input" phase is usually cancellable, and should be non-modal (but "stay on stop") on desktop in relation to the main view (e.g. you can scroll around in a document while deciding what name to give it when the "Save as" action is active). But when an action that "changes" something is active, it may or may not be possible to make changes (e.g. you can change the document background color and change table borders at the same time, but you might not be able to edit a document while a search is in progress) This gives us X types of "requesting input" properties: * Modality: Full, View-only, No * Cancellability: Yes, No The "operating" phase has those properties as well. The UI should run from one thread, and any operations should spawn separate threads and/or run in a thread pool (or asynchronously). Instead of full-blown threads, we could also use green threads.