Modified google plugin dialog
[mdictionary] / src / plugins / xdxf / XdxfDialog.h
index c5bea58..6108eff 100644 (file)
 
 *******************************************************************************/
 
-//Created by Mateusz Półrola
+/*!
+    \file XdxfDialog.cpp
+    \author Mateusz Półrola <mateusz.polrola@gmail.com>
+*/
 
 #ifndef XDXFDIALOG_H
 #define XDXFDIALOG_H
 #include <QtGui>
 #include "xdxfplugin.h"
 
+
+//! Implementation of xdxf plugin's dialogs.
+/*!
+    This class can create dialogs for adding new dictionary or changins settings
+     of existing one, based on dialog type passed to contructor.
+    When adding new dictionary dialog contains button to browse file system and
+    select dictionary file. When changing settings dialog displays basic
+    information about dictionary i. e. name, languages and license info.
+    In both types of dialogs there are comboboxes with cache and remove accents
+     options. On maemo right next to comboboxes are tool button which allow to
+     see more information about this options, on desktop the same information is
+     displayed as tool tip.
+    All content of dialog is in scroll area.
+*/
 class XdxfDialog : public QDialog
 {
     Q_OBJECT
 public:
+    /*!
+      Describes type of dialog. New means that dialog contains widgets to browse
+        file system and select dictionary file. Change means that dialog displays
+     information about dictionary.
+      In both types dialog provides widgets to create or delete cache and remove
+     or left accents.
+    */
     enum XdxfDialogType {New, Change};
 
+    //! Constructor
+    /*!
+        Creates new xdxf dialog
+        \param plugin if creating dialog of type Change it must be set to
+            pointer of plugin whose settings will be changed
+        \param type describes type of creating dialog
+        \param parent parent widget of creating dialog
+    */
     explicit XdxfDialog(XdxfPlugin* plugin = 0,
                         XdxfDialogType type = New,
-                        QWidget *parent = 0);
+                        QWidget* parent = 0);
 
+    //! Returns settings of plugin
+    /*!
+        After acceptance of dialog this method return plugin's settings based on
+         user choises in dialog.
+    */
     Settings* getSettings();
 
 Q_SIGNALS:
+    //! Request to show notification
     void notify(Notify::NotifyType, QString);
 
 public Q_SLOTS:
+    //! Reimplemented accept method, to check if all necessery fields in
+    //! dialog are correct e. g. dictionary file path
+    //! and saves new settings
     void accept();
 
 private Q_SLOTS:
+    //! displays dialog to browse and select file
     void selectFile();
-    void saveSettings();
     void setGenerateCache(bool);
     void setAccents(bool);
 
     #ifdef Q_WS_MAEMO_5
+        //! on maemo shows information about checkboxes
         void showCacheInfo();
         void showAccentsInfo();
     #endif
@@ -62,6 +104,9 @@ private Q_SLOTS:
 private:
     void initializeUI();
 
+    //! saves new settings after acceptance of dialog
+    void saveSettings();
+
     QLabel* infoLabel;
     QPushButton* browseButton;
     QHBoxLayout* browseLayout;