# Source: hk_kdeclasses/hk_kdeclasses/hk_kdequery.h

Annotated List
Files
Globals
Hierarchy
Index

    // ****************************************************************************
    // copyright (c) 2000-2004 Horst Knorr <hk_classes@knoda.org>
    // This file is part of the hk_kdeclasses library.
    // This file may be distributed and/or modified under the terms of the
    // GNU Library Public License version 2 as published by the Free Software
    // Foundation and appearing in the file LGPL included in the
    // packaging of this file.
    // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    // ****************************************************************************

    #ifndef HK_KDEQUERY_H
    #define HK_KDEQUERY_H

    #include <qvariant.h>
    #include <kparts/mainwindow.h>
    #include <kate/view.h>
    #include <kate/document.h>

    #include "hk_dsmodevisible.h"
    #include "hk_datasource.h"
    #include "hk_database.h"
    class QVBoxLayout;
    class QHBoxLayout;
    class QGridLayout;
    class QButtonGroup;
    class QTable;
    class QToolButton;
    class QMultiLineEdit;
    class hk_kdetoolbar;
    class hk_kdegrid;
    class hk_kdegridpart;

    /**
     *
     *@short KDE high level widget to define queries and see the result.
     *@version $Revision: 1.23 $
     *@author Horst Knorr (hk_classes@knoda.org)

     *hk_kdequery is a high level widget to define queries and see the result.
     *In this mode of development it has a field to enter the SQL query and a grid which shows the
     * resulting data if there is any. hk_kdequery also handles actionqueries correctly.
     */

    class hk_kdequery : public KParts::MainWindow ,public hk_dsquery
    {
        Q_OBJECT

            public:
            hk_kdequery(QWidget* w=0,const char* n=0,WFlags f=0);
            ~hk_kdequery();
            virtual bool            set_mode(enum_mode s);
    /**
     *shows the "design" window where you can enter the SQL modement
     */
            void set_sqlmode(void);
    /**
     *shows the result of the query if there is any.
     */
            void set_viewmode(void);
    /**
     * not developed yet. QBE means Query by Example.
     */
            void set_designmode(void);

    /**
     *returns true if the sqlwindow or the qbe window is shown. Else returns false (when the result data is shown)
     */
            bool in_designmode(void){return p_designmode;}
            virtual void set_datasource(hk_datasource*);
            hk_datasource* datasource(void);

    /**
     *when the datasource vanishes (i.e. will be destroyed) and autoclose is true, the hk_kdequery will be
     *closed otherwise it still is on your screen.
     */
            void set_autoclose(bool c){p_autoclose=c;}

    /**
     *if the designwindow should not be shown set this true. Default is false.
     */
            void set_nodesignmode(bool n);

            bool save_query(const hk_string& n="");
            bool load_query(void);
    	hk_dsgrid *grid(void);

        public slots:
            void designbutton_clicked(void);
            void querybutton_clicked(void);
            void query_changed(void);
            void savebutton_clicked(void);
            void saveasbutton_clicked(void);
            void close_query(void);
            void print(void);

        protected:
            virtual void before_source_vanishes(void);
            virtual void closeEvent ( QCloseEvent* e);
            void    keyPressEvent ( QKeyEvent * e );

        private:
            void set_caption(void);
            bool p_designmode;
            bool p_autoclose;
            bool p_sql_has_changed;
            bool p_nodesignmode;
            hk_kdegrid* p_grid;
    //    QMultiLineEdit* p_design;
            QWidget*    p_qbe;
            KRadioAction* p_designaction;
            KRadioAction* p_viewaction;
            KAction*      p_saveaction;
            KAction*  p_saveasaction;
            KAction*      p_closeaction;
            KAction*  p_printaction;
            KParts::ReadWritePart* p_part;
            Kate::View*    p_designkate;
    	Kate::Document* p_katepart;
            bool highlighting_set;

    };
    #endif

Generated by: horst on horstnotebook on Tue Mar 30 19:06:43 2004, using kdoc 2.0a54.