X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fuimanager.h;h=416256952cc762e811548d91473f3513eb5a244f;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=11693a5470f66550377ef821de9d0f2f6653cb12;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/uimanager.h b/synfig-studio/trunk/src/synfigapp/uimanager.h index 11693a5..4162569 100644 --- a/synfig-studio/trunk/src/synfigapp/uimanager.h +++ b/synfig-studio/trunk/src/synfigapp/uimanager.h @@ -2,19 +2,20 @@ /*! \file uimanager.h ** \brief User Interface Manager Class ** -** $Id: uimanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -50,63 +51,77 @@ public: RESPONSE_OK=2 }; virtual ~UIInterface() { } + virtual Response confirmation(const std::string &title, const std::string &primaryText, + const std::string &secondaryText, const std::string &confirmPhrase, + const std::string &cancelPhrase, Response dflt=RESPONSE_OK)=0; virtual Response yes_no(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0; virtual Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_YES)=0; virtual Response ok_cancel(const std::string &title, const std::string &message,Response dflt=RESPONSE_OK)=0; -}; +}; class DefaultUIInterface : public UIInterface { public: - Response yes_no(const std::string &title, const std::string &message,Response dflt) + Response confirmation(const std::string &/*title*/, const std::string &/*primaryText*/, + const std::string &/*secondaryText*/, const std::string &/*confirmPhrase*/, + const std::string &/*cancelPhrase*/, Response dflt) { return dflt; } - Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt) + Response yes_no(const std::string &/*title*/, const std::string &/*message*/,Response dflt) { return dflt; } - Response ok_cancel(const std::string &title, const std::string &message,Response dflt) + Response yes_no_cancel(const std::string &/*title*/, const std::string &/*message*/,Response dflt) { return dflt; } - - bool task(const std::string &task) + Response ok_cancel(const std::string &/*title*/, const std::string &/*message*/,Response dflt) + { return dflt; } + + bool task(const std::string &/*task*/) { return true; } - bool error(const std::string &task) + bool error(const std::string &/*task*/) { return true; } - bool warning(const std::string &task) + bool warning(const std::string &/*task*/) { return true; } - bool amount_complete(int current, int total) + bool amount_complete(int /*current*/, int /*total*/) { return true; } -}; +}; class ConfidentUIInterface : public UIInterface { public: - Response yes_no(const std::string &title, const std::string &message,Response dflt) + Response confirmation(const std::string &/*title*/, const std::string &/*primaryText*/, + const std::string &/*secondaryText*/, const std::string &/*confirmPhrase*/, + const std::string &/*cancelPhrase*/, Response /*dflt*/) + { return RESPONSE_OK; } + Response yes_no(const std::string &/*title*/, const std::string &/*message*/,Response /*dflt*/) { return RESPONSE_YES; } - Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt) + Response yes_no_cancel(const std::string &/*title*/, const std::string &/*message*/,Response /*dflt*/) { return RESPONSE_YES; } - Response ok_cancel(const std::string &title, const std::string &message,Response dflt) + Response ok_cancel(const std::string &/*title*/, const std::string &/*message*/,Response /*dflt*/) { return RESPONSE_OK; } - - bool task(const std::string &task) + + bool task(const std::string &/*task*/) { return true; } - bool error(const std::string &task) + bool error(const std::string &/*task*/) { return true; } - bool warning(const std::string &task) + bool warning(const std::string &/*task*/) { return true; } - bool amount_complete(int current, int total) + bool amount_complete(int /*current*/, int /*total*/) { return true; } -}; +}; class ConsoleUIInterface : public UIInterface { public: + Response confirmation(const std::string &title, const std::string &primaryText, + const std::string &secondaryText, const std::string &confirmPhrase, + const std::string &cancelPhrase, Response dflt); Response yes_no(const std::string &title, const std::string &message,Response dflt); Response yes_no_cancel(const std::string &title, const std::string &message,Response dflt); Response ok_cancel(const std::string &title, const std::string &message,Response dflt); - + bool task(const std::string &task); bool error(const std::string &task); bool warning(const std::string &task); bool amount_complete(int current, int total); -}; +}; }; // END of namespace synfigapp