~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to formatters/astyle_preferences.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of KDevelop
 
2
*  Copyright (C) 2008 Cédric Pasteur <cedric.pasteur@free.fr>
 
3
Copyright (C) 2001 Matthias Hölzer-Klüpfel <mhk@caldera.de>
 
4
 
 
5
This program is free software; you can redistribute it and/or
 
6
modify it under the terms of the GNU 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 program 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
General Public License for more details.
 
14
 
 
15
You should have received a copy of the GNU General Public License
 
16
along with this program; see the file COPYING.  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 ASTYLEPREFERENCES_H
 
22
#define ASTYLEPREFERENCES_H
 
23
 
 
24
#include <interfaces/isourceformatter.h>
 
25
#include "ui_astyle_preferences.h"
 
26
 
 
27
// class AStylePlugin;
 
28
class AStyleFormatter;
 
29
 
 
30
class AStylePreferences : public KDevelop::SettingsWidget, public Ui::AStylePreferences
 
31
{
 
32
        Q_OBJECT
 
33
 
 
34
    public:
 
35
        enum Language { CPP, Java, CSharp};
 
36
        
 
37
        AStylePreferences(Language lang=CPP, QWidget *parent=0);
 
38
        virtual ~AStylePreferences();
 
39
 
 
40
        virtual void load(const KDevelop::SourceFormatterStyle &style);
 
41
        virtual QString save();
 
42
 
 
43
    protected:
 
44
        void init();
 
45
        void updatePreviewText(bool emitChangedSignal = true);
 
46
        void setItemChecked(int idx, bool checked);
 
47
        void updateWidgets();
 
48
 
 
49
    private slots:
 
50
        void currentTabChanged();
 
51
        void indentChanged();
 
52
        void indentObjectsChanged(QListWidgetItem *item);
 
53
        void minMaxValuesChanged();
 
54
        void bracketsChanged();
 
55
        void blocksChanged();
 
56
        void paddingChanged();
 
57
        void onelinersChanged();
 
58
 
 
59
    private:
 
60
        AStyleFormatter *m_formatter;
 
61
        Language m_lang;
 
62
        bool m_enableWidgetSignals;
 
63
};
 
64
 
 
65
#endif // ASTYLEPREFERENCES_H