~ubuntu-branches/ubuntu/quantal/kiten/quantal-proposed

« back to all changes in this revision

Viewing changes to lib/dictionarypreferencedialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2011-07-10 11:23:47 UTC
  • Revision ID: james.westby@ubuntu.com-20110710112347-ykfhtvam3kgssspo
Tags: upstream-4.6.90+repack
ImportĀ upstreamĀ versionĀ 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * This file is part of Kiten, a KDE Japanese Reference Tool                 *
 
3
 * Copyright (C) 2006 Joseph Kerian <jkerian@gmail.com>                      *
 
4
 *                                                                           *
 
5
 * This library is free software; you can redistribute it and/or             *
 
6
 * modify it under the terms of the GNU Library General Public               *
 
7
 * License as published by the Free Software Foundation; either              *
 
8
 * version 2 of the License, or (at your option) any later version.          *
 
9
 *                                                                           *
 
10
 * This library is distributed in the hope that it will be useful,           *
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
 
13
 * Library General Public License for more details.                          *
 
14
 *                                                                           *
 
15
 * You should have received a copy of the GNU Library General Public License *
 
16
 * along with this library; see the file COPYING.LIB.  If not, write to      *
 
17
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
 
18
 * Boston, MA 02110-1301, USA.                                               *
 
19
 *****************************************************************************/
 
20
 
 
21
#ifndef KITEN_DICTIONARYPREFERENCEDIALOG_H
 
22
#define KITEN_DICTIONARYPREFERENCEDIALOG_H
 
23
 
 
24
#include <QWidget>
 
25
 
 
26
#include "libkitenexport.h"
 
27
 
 
28
/**
 
29
 * @short This abstract base class specifies the interface for dictionary
 
30
 * preference dialogs in user applications. The DictionaryManager class can be
 
31
 * asked for a list of these objects for the current session, and the appropriate
 
32
 * signal/slot connections can be made to handle dictionary preferences transparently
 
33
 * to the user application.
 
34
 *
 
35
 * One annoying caveat is that the user application still has to add preference elements
 
36
 * to it's own kcfg file, or the preference code will crash when trying to work with it.
 
37
 * Sadly, at the moment the only way to figure out what needs to be added to the kcfg is
 
38
 * to read the code, or the kiten.kcfg implementation.
 
39
 *
 
40
 * @author Joseph Kerian \<jkerian@gmail.com\>
 
41
 */
 
42
class KITEN_EXPORT DictionaryPreferenceDialog : public QWidget
 
43
{
 
44
  Q_OBJECT
 
45
 
 
46
  public:
 
47
    /**
 
48
     * Basic constructor. Used by internal classes only. Implement if you are
 
49
     * adding your own dictionary type.
 
50
     *
 
51
     * @param parent the parent widget, as per normal Qt Widget handling
 
52
     * @param name the name of your widget, as understood by the preference code
 
53
     */
 
54
    DictionaryPreferenceDialog( QWidget *parent, const QString &name );
 
55
    /**
 
56
     * Basic destructor
 
57
     */
 
58
    virtual ~DictionaryPreferenceDialog();
 
59
    /**
 
60
     * Get the dictionary type name associated with this dialog
 
61
     */
 
62
    QString name() const;
 
63
 
 
64
  public Q_SLOTS:
 
65
    /**
 
66
     * Connect the signal of your preferenes dialog to this updateWidgets slot, to handle reading
 
67
     * preference settings cleanly. You can also call this slot directly from your own updateWidgets slot.
 
68
     */
 
69
    virtual void updateWidgets() = 0;
 
70
    /**
 
71
     * Connect the signal of your preferenes dialog to this updateWidgetsDefault slot, to handle setting
 
72
     * preference settings back to their default settings easily.
 
73
     */
 
74
    virtual void updateWidgetsDefault() = 0;
 
75
    /**
 
76
     * Connect the signal of your preferenes dialog to this updateSettings slot, to handle saving
 
77
     * user's preference information.
 
78
     */
 
79
    virtual void updateSettings() = 0;
 
80
 
 
81
  Q_SIGNALS:
 
82
    /**
 
83
     * When the user edits something on this preference page, this signal should be emitted
 
84
     */
 
85
    void widgetChanged();
 
86
 
 
87
  protected:
 
88
    /**
 
89
     * A place to store the name, passed in the constructor
 
90
     */
 
91
    QString m_name;
 
92
};
 
93
 
 
94
#endif