From c87ffbf5a0a36187af61530c03fea5c4cafcdc2b Mon Sep 17 00:00:00 2001 From: fgerlits Date: Tue, 19 Apr 2005 09:15:57 +0000 Subject: [PATCH] added SearchWindow source files --- .../gLiveSupport/src/SearchWindow.cxx | 90 +++++++++ .../products/gLiveSupport/src/SearchWindow.h | 191 ++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 livesupport/products/gLiveSupport/src/SearchWindow.cxx create mode 100644 livesupport/products/gLiveSupport/src/SearchWindow.h diff --git a/livesupport/products/gLiveSupport/src/SearchWindow.cxx b/livesupport/products/gLiveSupport/src/SearchWindow.cxx new file mode 100644 index 000000000..b8d91cc2e --- /dev/null +++ b/livesupport/products/gLiveSupport/src/SearchWindow.cxx @@ -0,0 +1,90 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport 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. + + LiveSupport 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. + + You should have received a copy of the GNU General Public License + along with LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision: 1.1 $ + Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.cxx,v $ + +------------------------------------------------------------------------------*/ + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include +#include + +#include "LiveSupport/Widgets/WidgetFactory.h" +#include "SearchWindow.h" + + +using namespace Glib; + +using namespace LiveSupport::Core; +using namespace LiveSupport::Widgets; +using namespace LiveSupport::GLiveSupport; + +/* =================================================== local data structures */ + + +/* ================================================ local constants & macros */ + + +/* =============================================== local function prototypes */ + + +/* ============================================================= module code */ + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +SearchWindow :: SearchWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle) + throw () + : WhiteWindow(WidgetFactory::searchWindowTitleImage, + Colors::White, + WidgetFactory::getInstance()->getWhiteWindowCorners()), + LocalizedObject(bundle) +{ + this->gLiveSupport = gLiveSupport; + + // show + set_name("searchWindow"); + set_default_size(300, 300); + set_modal(false); + property_window_position().set_value(Gtk::WIN_POS_NONE); + +// showContents(); + show_all_children(); +} + + +/*------------------------------------------------------------------------------ + * Destructor. + *----------------------------------------------------------------------------*/ +SearchWindow :: ~SearchWindow (void) throw () +{ +} + diff --git a/livesupport/products/gLiveSupport/src/SearchWindow.h b/livesupport/products/gLiveSupport/src/SearchWindow.h new file mode 100644 index 000000000..b80c39b07 --- /dev/null +++ b/livesupport/products/gLiveSupport/src/SearchWindow.h @@ -0,0 +1,191 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport 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. + + LiveSupport 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. + + You should have received a copy of the GNU General Public License + along with LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision: 1.1 $ + Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.h,v $ + +------------------------------------------------------------------------------*/ +#ifndef SearchWindow_h +#define SearchWindow_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include + +#include +#include +#include + +#include "LiveSupport/Core/Ptr.h" +#include "LiveSupport/Core/LocalizedObject.h" +#include "LiveSupport/Widgets/WhiteWindow.h" +#include "LiveSupport/Widgets/Button.h" +#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" +#include "GLiveSupport.h" + +namespace LiveSupport { +namespace GLiveSupport { + +using namespace boost::posix_time; +using namespace LiveSupport::Core; +using namespace LiveSupport::Widgets; + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * The Search/Browse window. + * + * @author $Author: fgerlits $ + * @version $Revision: 1.1 $ + */ +class SearchWindow : public WhiteWindow, public LocalizedObject +{ + private: + + protected: + + /** + * The columns model needed by Gtk::TreeView. + * Lists one clip per row. + * + * @author $Author: fgerlits $ + * @version $Revision: 1.1 $ + */ + class ModelColumns : public ZebraTreeModelColumnRecord + { + public: + /** + * The column for the type of the entry in the list + */ + Gtk::TreeModelColumn typeColumn; + + /** + * The column for the playable object shown in the row. + */ + Gtk::TreeModelColumn::Ref> playableColumn; + + /** + * The column for the title of the audio clip or playlist. + */ + Gtk::TreeModelColumn titleColumn; + + /** + * The column for the creator of the audio clip or playlist. + */ + Gtk::TreeModelColumn creatorColumn; + + /** + * The column for the length of the audio clip or playlist. + */ + Gtk::TreeModelColumn lengthColumn; + + /** + * Constructor. + */ + ModelColumns(void) throw () + { + add(typeColumn); + add(playableColumn); + add(titleColumn); + add(creatorColumn); + add(lengthColumn); + } + }; + + + /** + * The GLiveSupport object, holding the state of the application. + */ + Ptr::Ref gLiveSupport; + + /** + * The column model. + */ + ModelColumns modelColumns; + + /** + * The main container in the window. + */ + Gtk::VBox vBox; + + /** + * A scrolled window, so that the list can be scrolled. + */ + Gtk::ScrolledWindow scrolledWindow; + + /** + * The tree view. + */ + ZebraTreeView * treeView; + + /** + * The tree model, as a GTK reference. + */ + Glib::RefPtr treeModel; + + public: + + /** + * Constructor. + * + * @param gLiveSupport the GLiveSupport, application object. + * @param bundle the resource bundle holding the localized + * resources for this window + */ + SearchWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle) throw (); + + /** + * Virtual destructor. + */ + virtual + ~SearchWindow(void) throw (); +}; + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace GLiveSupport +} // namespace LiveSupport + +#endif // SearchWindow_h +