/***************************************************************************
                          klogger.h  -  description                              
                             -------------------                                         
    begin                : Sun Jun  6 11:42:22 CEST 1999
                                           
    copyright            : (C) 1999 by Heiner Lamprecht                         
    email                : heiner@kijumfo.de                                     
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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.                                   * 
 *                                                                         *
 ***************************************************************************/


#ifndef KLOGGER_H
#define KLOGGER_H
 

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

// include files for QT
#include <qprinter.h>
#include <qpainter.h>
#include <qpoint.h>

// include files for KDE 
#include <kapp.h> 
#include <ktmainwindow.h> 
#include <kaccel.h>
#include <kiconloader.h>
#include <kmsgbox.h>

// application specific includes
#include <kloggerview.h>

/**
  * This Class is the base class for KLogger. It sets up the main
  * window and reads the config file as well as providing a menubar,
	* toolbar and statusbar. For the main view, an instance of class
	* KLoggerView is created which creates the view.
  * @author Heiner Lamprecht
  */
class KLoggerApp : public KTMainWindow 
{
  Q_OBJECT

public:
  /** construtor */
  KLoggerApp(); 
  /** destructor */
  ~KLoggerApp();
  /** initMenuBar creates the menu_bar and inserts the menuitems */
  void initMenuBar();
  /** creates the toolbars. */
  void initToolBar();
  /** setup the statusbar */
  void initStatusBar();
  /** setup the view of the map */
  void initMapView();
  /** setup the view of the db-access */
  void initDBView();
  /** save the app-specific options on slotAppExit or by an Options
		* dialog */
  void saveOptions();
  /** read the app-specific options on init() or by an Options dialog */
  void readOptions();
  /** enable menuentries/toolbar items */
  void enableCommand(int id_);
  /** disable menuentries/toolbar items */
  void disableCommand(int id_);
  /** overloaded for Message box on last window exit */
  bool queryExit();
	/** display the coordinates in the statusbar*/
	void showCoords(QPoint coord);


 public slots:
  /** switch argument for slot selection by menu or toolbar ID */
  void commandCallback(int id_);
  /** switch argument for Statusbar help entries on slot selection */
  void statusCallback(int id_);
  /** open a new application window */
  void slotFileNewWindow();
  /** generate a new document in the actual view */
  void slotFileNew();
  /** open a document */
  void slotFileOpen();
  /** save a document */
  void slotFileSave();
  /** save a document under a different filename*/
  void slotFileSaveAs();
  /** close the actual file */
  void slotFileClose();
  /** print the actual file */
  void slotFilePrint();
  /** close the current window */
  void slotFileCloseWindow();
  /** exits the application */
  void slotFileQuit();
  /** put the marked text/object into the clipboard and remove
    *	it from the document */
  void slotEditCut();
  /** put the marked text/object into the clipboard*/
  void slotEditCopy();
  /** paste the clipboard into the document*/
  void slotEditPaste();
  /** toggle the toolbar*/
  void slotViewToolBar();
  /** toggle the private toolbar*/
  void slotViewToolBar1();
  /** toggle the statusbar*/
  void slotViewStatusBar();
  /** change the status message to text */
  void slotStatusMsg(const char *text);
  /** change the status message of the whole statusbar temporary */
  void slotStatusHelpMsg(const char *text);
  /** change the status message of the whole statusbar temporary */
  void slotStatusHelpMsga();

private:
  /** file_menu contains all items of the menubar entry "File" */
  QPopupMenu *file_menu;
  /** edit_menu contains all items of the menubar entry "Edit" */
  QPopupMenu *edit_menu;
  /** view_menu contains all items of the menubar entry "View" */
  QPopupMenu *view_menu;
	/**	logger_menu contains all items of the menubar entry "???" */
	QPopupMenu *logger_menu;
  /** help_menu contains all items of the menubar entry "Help" */
  QPopupMenu *help_menu;
  /**
		* view is the main widget which represents your working area. The
		* View class should handle all events of the view widget. It is kept
		* empty so you can create your view according to your application's
		* needs by changing the view class. */
  KLoggerView *view;

  /**
		* doc represents your actual document and is created only once. It
		* keeps information such as filename and does the serialization of
		* your files. */
  KLoggerDoc *doc;

  /**
		* flag if toolbar is visible or not. Used for kconfig and checking the
    * view-menu entry view toolbar. bViewStatusbar does the same for the
    * statusbar.
    */
  bool bViewToolbar;
  bool bViewStatusbar;
  /**
		* used for KConfig to store and restore menubar position. Same with
    * tool_bar_pos. If more menubars or toolbars are created, you should
		* add positions as well and implement them in saveOptions() and
		* readOptions().
		*/
  KMenuBar::menuPosition menu_bar_pos;
  KToolBar::BarPosition tool_bar_pos;

};   
 
#endif // KLOGGER_H



















Documentation generated by heiner@Tharbad on Fri Jun 25 22:35:51 CEST 1999