/home/frank/projects/kitlist/src/kitlistgui.cpp File Reference

#include "kitlistgui.hpp"
#include "printing.hpp"
#include <cassert>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/aboutdialog.h>
#include <gtkmm/cellrenderertoggle.h>
#include <gtkmm/clipboard.h>
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/menuitem.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/stock.h>
#include <gtkmm/targetentry.h>
#include <gtkmm/window.h>
#include <libglademm/xml.h>
#include <libxml++/libxml++.h>
#include <string>
#include <sstream>
#include <sys/stat.h>
#include <config.h>

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{kitlistgui.cpp}

Defines

#define KITLIST_SERVICE_NAME   "com.nokia."PACKAGE_NAME
 Maemo service name.
#define KITLIST_SERVICE_OBJECT   "/com/nokia/"PACKAGE_NAME
 Maemo service path.
#define KITLIST_SERVICE_IFACE   "com.nokia."PACKAGE_NAME
 Maemo service interface name.

Typedefs

typedef Gtk::TreeModel::Children type_children

Functions

const bool file_exists (const Glib::ustring &filename)
 Returns true if the passed file exists.
const string load_resource_glade_file (const Glib::ustring &filename)
 Locate the Glade resource file from a list of potential locations.
Glib::RefPtr< Gnome::Glade::Xml > get_glade_ref_ptr (const string &filename, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring())
 Returns a reference to the Glade resource file.

Variables

const string anonymous_namespace{kitlistgui.cpp}::GLADE_APP_FILE = "kitlist.glade"
 Resource file name.
const guint anonymous_namespace{kitlistgui.cpp}::SB_ITEM_COUNT = 1000
 Status bar message constant for displaying item counts.
const guint anonymous_namespace{kitlistgui.cpp}::SB_SAVE = SB_ITEM_COUNT + 1
 Status bar message constant for save notifications.
const guint anonymous_namespace{kitlistgui.cpp}::SB_MSG = SB_SAVE + 1
 Status bar message constant for general messages.
const guint anonymous_namespace{kitlistgui.cpp}::SB_PRINT = SB_MSG + 1
 Status bar message constant for printer messages.
const char anonymous_namespace{kitlistgui.cpp}::item_target_custom [] = "kitlistclipboard"
 Key used for custom clipboard.
const char anonymous_namespace{kitlistgui.cpp}::item_target_text [] = "text/plain"
 Mime type for clipboard content.
const char anonymous_namespace{kitlistgui.cpp}::XML_ELEMENT_ID [] = "id"
 Tag name for the ID element in the clipbard XML document.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::DEFAULT_FILENAME_EXTENSION = ".kit"
 Default filename extension.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::PDF_FILENAME_EXTENSION = ".pdf"
 PDF filename extension.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::DEFAULT_FILENAME = "kitlist" + DEFAULT_FILENAME_EXTENSION
 The default filename.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY = "/apps/kitlist"
 The application's root key in the GConf hierarchy.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_CURRENT_FILENAME = GCONF_KEY + "/current_filename"
 GConf entry for the current filename.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_PAGE_TITLE = GCONF_KEY + "/page_title"
 GConf entry for the page title.
const gint anonymous_namespace{kitlistgui.cpp}::DEFAULT_MAX_RECENT_FILES = 4
 The maximum number of recent files to maintain.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_RECENT_FILES = GCONF_KEY + "/recent_files"
 GConf entry for recent files.
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_MAX_RECENT_FILES = GCONF_KEY + "/max_recent_files"
 GConf entry for max recent files.


Define Documentation

#define KITLIST_SERVICE_IFACE   "com.nokia."PACKAGE_NAME

Maemo service interface name.

Definition at line 55 of file kitlistgui.cpp.

Referenced by KitListGui::init().

#define KITLIST_SERVICE_NAME   "com.nokia."PACKAGE_NAME

Maemo service name.

Definition at line 51 of file kitlistgui.cpp.

Referenced by KitListGui::init().

#define KITLIST_SERVICE_OBJECT   "/com/nokia/"PACKAGE_NAME

Maemo service path.

Definition at line 53 of file kitlistgui.cpp.

Referenced by KitListGui::init().


Typedef Documentation

typedef Gtk::TreeModel::Children type_children

Definition at line 146 of file kitlistgui.cpp.


Function Documentation

const bool file_exists ( const Glib::ustring &  filename  ) 

Returns true if the passed file exists.

Note: We do not test for the file type, just it's existence regardless of whether it's a directory etc.

Parameters:
filename The file to test for existence.
Returns:
true if the file exists.

Definition at line 157 of file kitlistgui.cpp.

Referenced by KitListGui::choose_filename(), KitListGui::choose_pdf_filename(), KitListGui::init(), and load_resource_glade_file().

Glib::RefPtr<Gnome::Glade::Xml> get_glade_ref_ptr ( const string &  filename,
const Glib::ustring &  root = Glib::ustring(),
const Glib::ustring &  domain = Glib::ustring() 
)

Returns a reference to the Glade resource file.

Attempts to locate the external Glade resource file from a number of common locations.

Definition at line 186 of file kitlistgui.cpp.

References load_resource_glade_file().

Referenced by KitListGui::init().

const string load_resource_glade_file ( const Glib::ustring &  filename  ) 

Locate the Glade resource file from a list of potential locations.

Definition at line 167 of file kitlistgui.cpp.

References file_exists().

Referenced by get_glade_ref_ptr().


Copyright 2008-2010 Frank Dean