1 /* === S Y N F I G ========================================================= */
3 ** \brief User Interface Manager Class
5 ** $Id: uimanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_APP_UIMANAGER_H
26 #define __SYNFIG_APP_UIMANAGER_H
28 /* === H E A D E R S ======================================================= */
31 #include <synfig/general.h>
32 #include <synfig/string.h>
33 #include <sigc++/object.h>
35 /* === M A C R O S ========================================================= */
37 /* === T Y P E D E F S ===================================================== */
39 /* === C L A S S E S & S T R U C T S ======================================= */
43 class UIInterface : public etl::shared_object, public synfig::ProgressCallback, public sigc::trackable
53 virtual ~UIInterface() { }
54 virtual Response yes_no(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
55 virtual Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0;
56 virtual Response ok_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_OK)=0;
59 class DefaultUIInterface : public UIInterface
62 Response yes_no(const std::string &title, const std::string &message,Response dflt)
64 Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
66 Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
69 bool task(const std::string &task)
71 bool error(const std::string &task)
73 bool warning(const std::string &task)
75 bool amount_complete(int current, int total)
79 class ConfidentUIInterface : public UIInterface
82 Response yes_no(const std::string &title, const std::string &message,Response dflt)
83 { return RESPONSE_YES; }
84 Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt)
85 { return RESPONSE_YES; }
86 Response ok_cancel(const std::string &title, const std::string &message,Response dflt)
87 { return RESPONSE_OK; }
89 bool task(const std::string &task)
91 bool error(const std::string &task)
93 bool warning(const std::string &task)
95 bool amount_complete(int current, int total)
99 class ConsoleUIInterface : public UIInterface
102 Response yes_no(const std::string &title, const std::string &message,Response dflt);
103 Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt);
104 Response ok_cancel(const std::string &title, const std::string &message,Response dflt);
106 bool task(const std::string &task);
107 bool error(const std::string &task);
108 bool warning(const std::string &task);
109 bool amount_complete(int current, int total);
112 }; // END of namespace synfigapp
114 /* === E N D =============================================================== */