Changeset View
Changeset View
Standalone View
Standalone View
src/HistorySizeWidget.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | 43 | | |||
44 | public: | 44 | public: | ||
45 | explicit HistorySizeWidget(QWidget *parent); | 45 | explicit HistorySizeWidget(QWidget *parent); | ||
46 | ~HistorySizeWidget() Q_DECL_OVERRIDE; | 46 | ~HistorySizeWidget() Q_DECL_OVERRIDE; | ||
47 | 47 | | |||
48 | /** Specifies the history mode. */ | 48 | /** Specifies the history mode. */ | ||
49 | void setMode(Enum::HistoryModeEnum aMode); | 49 | void setMode(Enum::HistoryModeEnum aMode); | ||
50 | 50 | | |||
51 | /* Temporary specifies that this widget is transitory and the settings will not be saved. */ | ||||
52 | void setTemporary(bool temporary); | ||||
53 | | ||||
51 | /** Returns the history mode chosen by the user. */ | 54 | /** Returns the history mode chosen by the user. */ | ||
52 | Enum::HistoryModeEnum mode() const; | 55 | Enum::HistoryModeEnum mode() const; | ||
53 | 56 | | |||
54 | /** Sets the number of lines for the fixed size history mode. */ | 57 | /** Sets the number of lines for the fixed size history mode. */ | ||
55 | void setLineCount(int lines); | 58 | void setLineCount(int lines); | ||
56 | 59 | | |||
57 | /** | 60 | /** | ||
58 | * Returns the number of lines of history to remember. | 61 | * Returns the number of lines of history to remember. | ||
59 | * This is only valid when mode() == FixedSizeHistory, | 62 | * This is only valid when mode() == FixedSizeHistory, | ||
60 | * and returns 0 otherwise. | 63 | * and returns 0 otherwise. | ||
61 | */ | 64 | */ | ||
62 | int lineCount() const; | 65 | int lineCount() const; | ||
63 | 66 | | |||
64 | /** | | |||
65 | * Return height which should be set on the widget's label | | |||
66 | * to align with the first widget's item | | |||
67 | */ | | |||
68 | int preferredLabelHeight(); | | |||
69 | | ||||
70 | Q_SIGNALS: | 67 | Q_SIGNALS: | ||
71 | /** Emitted when the history mode is changed. */ | 68 | /** Emitted when the history mode is changed. */ | ||
72 | void historyModeChanged(Enum::HistoryModeEnum); | 69 | void historyModeChanged(Enum::HistoryModeEnum); | ||
73 | 70 | | |||
74 | /** Emitted when the history size is changed. */ | 71 | /** Emitted when the history size is changed. */ | ||
75 | void historySizeChanged(int); | 72 | void historySizeChanged(int); | ||
76 | 73 | | |||
77 | private Q_SLOTS: | | |||
78 | void buttonClicked(QAbstractButton *); | | |||
79 | | ||||
80 | private: | 74 | private: | ||
81 | Ui::HistorySizeWidget *_ui; | 75 | Ui::HistorySizeWidget *_ui; | ||
82 | 76 | bool _temporary; | |||
83 | // 1000 lines was the default in the KDE3 series | 77 | // 1000 lines was the default in the KDE3 series | ||
84 | static const int DefaultLineCount = 1000; | 78 | static const int DefaultLineCount = 1000; | ||
85 | }; | 79 | }; | ||
86 | } | 80 | } | ||
87 | 81 | | |||
88 | #endif // HISTORYSIZEWIDGET_H | 82 | #endif // HISTORYSIZEWIDGET_H |