digikam
advancedrenamewidget.h
Go to the documentation of this file.00001 /* ============================================================ 00002 * 00003 * This file is a part of digiKam project 00004 * http://www.digikam.org 00005 * 00006 * Date : 2009-05-22 00007 * Description : a control widget for the AdvancedRename utility 00008 * 00009 * Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net> 00010 * 00011 * This program is free software; you can redistribute it 00012 * and/or modify it under the terms of the GNU General 00013 * Public License as published by the Free Software Foundation; 00014 * either version 2, or (at your option) 00015 * any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * ============================================================ */ 00023 00024 #ifndef ADVANCEDRENAMEWIDGET_H 00025 #define ADVANCEDRENAMEWIDGET_H 00026 00027 // Qt includes 00028 00029 #include <QtGui/QWidget> 00030 #include <QtCore/QString> 00031 00032 namespace Digikam 00033 { 00034 00035 class ParseInformation; 00036 class Parser; 00037 class AdvancedRenameWidgetPriv; 00038 00039 class AdvancedRenameWidget : public QWidget 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 00045 AdvancedRenameWidget(QWidget* parent = 0); 00046 ~AdvancedRenameWidget(); 00047 00048 enum ControlWidget 00049 { 00050 None = 0x0, 00051 ToolTipButton = 0x1, 00052 TokenButtons = 0x2, 00053 TokenToolButton = 0x4, 00054 ModifierButtons = 0x8, 00055 ModifierToolButton = 0x10, 00056 00057 DefaultControls = TokenButtons | ToolTipButton | ModifierToolButton 00058 }; 00059 Q_DECLARE_FLAGS(ControlWidgets, ControlWidget) 00060 00061 QString text() const; 00062 void setText(const QString& text); 00063 void clearText(); 00064 00065 /* 00066 * clear the text as well as the history 00067 */ 00068 void clear(); 00069 00070 void setParser(Parser* parser); 00071 void setControlWidgets(ControlWidgets mask); 00072 00073 QString parse(ParseInformation& info) const; 00074 00075 void setTooltipAlignment(Qt::Alignment alignment); 00076 void focusLineEdit(); 00077 00078 Q_SIGNALS: 00079 00080 void signalTextChanged(const QString&); 00081 void signalReturnPressed(); 00082 00083 public Q_SLOTS: 00084 00085 void slotUpdateTrackerPos(); 00086 void slotHideToolTipTracker(); 00087 00088 private Q_SLOTS: 00089 00090 void slotToolTipButtonToggled(bool); 00091 void slotTokenMarked(bool); 00092 00093 private: 00094 00095 void createToolTip(); 00096 void registerParserControls(); 00097 void setupWidgets(); 00098 00099 void readSettings(); 00100 void writeSettings(); 00101 00102 private: 00103 00104 AdvancedRenameWidgetPriv* const d; 00105 }; 00106 00107 } // namespace Digikam 00108 00109 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::AdvancedRenameWidget::ControlWidgets) 00110 00111 #endif /* ADVANCEDRENAMEWIDGET_H */
KDE 4.4 API Reference