cwidget 0.5.16
dialogs.h
Go to the documentation of this file.
00001 // dialogs.h      -*-c++-*-
00002 //
00003 //   Copyright (C) 2000, 2007-2008 Daniel Burrows
00004 //
00005 //   This program is free software; you can redistribute it and/or
00006 //   modify it under the terms of the GNU General Public License as
00007 //   published by the Free Software Foundation; either version 2 of
00008 //   the License, or (at your option) any later version.
00009 //
00010 //   This program is distributed in the hope that it will be useful,
00011 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 //   General Public License for more details.
00014 //
00015 //   You should have received a copy of the GNU General Public License
00016 //   along with this program; see the file COPYING.  If not, write to
00017 //   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018 //   Boston, MA 02111-1307, USA.
00019 
00028 #ifndef DIALOGS_H
00029 #define DIALOGS_H
00030 
00031 #include <cwidget/widgets/editline.h> // for editline::history_list
00032 
00033 #include <cwidget/generic/util/slotarg.h>
00034 
00035 #include <string>
00036 
00037 namespace cwidget
00038 {
00039   class fragment;
00040   class style;
00041 
00042   namespace widgets
00043   {
00044     class pager;
00045     class widget;
00046   }
00047 
00049   namespace dialogs
00050   {
00051     // Canned dialog-boxes:
00052 
00064     widgets::widget_ref ok(const widgets::widget_ref &widget,
00065                            util::slot0arg okslot, const std::wstring &label,
00066                            const style &st);
00067 
00068     widgets::widget_ref ok(fragment *msg, util::slot0arg okslot=NULL, bool scrollbar=false);
00069     widgets::widget_ref ok(fragment *msg, util::slot0arg okslot, const style &st, bool scrollbar=false);
00070     widgets::widget_ref ok(fragment *msg, util::slot0arg okslot, const std::wstring &label,
00071                            const style &st, bool scrollbar=false);
00072 
00073     widgets::widget_ref ok(const std::wstring &msg, util::slot0arg okslot=NULL);
00074     widgets::widget_ref ok(const std::wstring &msg, util::slot0arg okslot,
00075                            const style &st);
00076     widgets::widget_ref ok(const std::wstring &msg, util::slot0arg okslot, const std::wstring &label,
00077                            const style &st);
00078 
00097     widgets::widget_ref yesno(const widgets::widget_ref &widget,
00098                               util::slot0arg yesslot,
00099                               const std::wstring &yeslabel,
00100                               util::slot0arg noslot,
00101                               const std::wstring &nolabel,
00102                               const style &st,
00103                               bool deflt=true);
00104 
00105     widgets::widget_ref yesno(fragment *msg,
00106                               util::slot0arg yesslot,
00107                               util::slot0arg noslot,
00108                               bool scrollbar=false,
00109                               bool deflt=true);
00110     widgets::widget_ref yesno(fragment *msg,
00111                               util::slot0arg yesslot,
00112                               util::slot0arg noslot,
00113                               const style &st,
00114                               bool scrollbar=false,
00115                               bool deflt=true);
00116     widgets::widget_ref yesno(fragment *msg,
00117                               util::slot0arg yesslot,
00118                               const std::wstring &yeslabel,
00119                               util::slot0arg noslot,
00120                               const std::wstring &nolabel,
00121                               const style &st,
00122                               bool scrollbar=false,
00123                               bool deflt=true);
00124 
00125     widgets::widget_ref yesno(const std::wstring &msg,
00126                               util::slot0arg yesslot,
00127                               util::slot0arg noslot,
00128                               bool deflt=true);
00129     widgets::widget_ref yesno(const std::wstring &msg,
00130                               util::slot0arg yesslot,
00131                               util::slot0arg noslot,
00132                               const style &st,
00133                               bool deflt=true);
00134     widgets::widget_ref yesno(const std::wstring &msg,
00135                               util::slot0arg yesslot,
00136                               const std::wstring &yeslabel,
00137                               util::slot0arg noslot,
00138                               const std::wstring &nolabel,
00139                               const style &st,
00140                               bool deflt=true);
00141 
00142     widgets::widget_ref fileview(const std::string &fn,
00143                                  util::slot0arg okslot=NULL,
00144                                  util::slotarg<sigc::slot1<void, widgets::pager &> > search_slot=NULL,
00145                                  util::slotarg<sigc::slot1<void, widgets::pager &> > repeat_search_slot=NULL,
00146                                  util::slotarg<sigc::slot1<void, widgets::pager &> > repeat_search_back_slot=NULL,
00147                                  const char *encoding=NULL);
00148     widgets::widget_ref fileview(const std::string &fn,
00149                                  util::slot0arg okslot,
00150                                  util::slotarg<sigc::slot1<void, widgets::pager &> > search_slot,
00151                                  util::slotarg<sigc::slot1<void, widgets::pager &> > repeat_search_slot,
00152                                  util::slotarg<sigc::slot1<void, widgets::pager &> > repeat_search_back_slot,
00153                                  const style &st,
00154                                  const char *encoding=NULL);
00155 
00156     widgets::widget_ref string(fragment *msg,
00157                                const std::wstring &deflt,
00158                                util::slotarg<sigc::slot1<void, std::wstring> > okslot,
00159                                util::slotarg<sigc::slot0<void> > cancel_slot,
00160                                util::slotarg<sigc::slot1<void, std::wstring> > changed_slot,
00161                                widgets::editline::history_list *history,
00162                                const style &st);
00163 
00164     widgets::widget_ref string(const std::wstring &msg,
00165                                const std::wstring &deflt,
00166                                util::slotarg<sigc::slot1<void, std::wstring> > okslot,
00167                                util::slotarg<sigc::slot0<void> > cancel_slot,
00168                                util::slotarg<sigc::slot1<void, std::wstring> > changed_slot,
00169                                widgets::editline::history_list *history,
00170                                const style &st);
00171 
00172     widgets::widget_ref string(const std::wstring &msg,
00173                                const std::wstring &deflt,
00174                                util::slotarg<sigc::slot1<void, std::wstring> > slot,
00175                                util::slotarg<sigc::slot0<void> > cancel_slot,
00176                                util::slotarg<sigc::slot1<void, std::wstring> > changed_slot,
00177                                widgets::editline::history_list *history);
00178   }
00179 }
00180 
00181 #endif