[a85834]: src / gui / additemdialog.h  Maximize  Restore  History

Download this file

115 lines (105 with data), 3.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* PDFedit - free program for PDF document manipulation.
* Copyright (C) 2006, 2007, 2008 PDFedit team: Michal Hocko,
* Miroslav Jahoda,
* Jozef Misutka,
* Martin Petricek
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in doc/LICENSE.GPL); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Project is hosted on http://sourceforge.net/projects/pdfedit
*/
#ifndef __ADDITEMDIALOG_H__
#define __ADDITEMDIALOG_H__
#include "selfdestructivewidget.h"
#include "qtcompat.h"
#include <kernel/iproperty.h>
#include <kernel/cobject.h>
namespace pdfopbjects {
class CPdf;
}
class QBoxLayout;
class QFrame;
class QRadioButton;
class Q_ButtonGroup;
class QLineEdit;
class QLabel;
namespace gui {
using namespace pdfobjects;
class Property;
/** Number of property types that can be added in AddItemDialog */
const int addDialogPropertyTypes=8;
/**
Class representing dialog for adding new item to Dictionary/array<br>
Dialog does not block focus of main window and you can have multiple of them opened simultaneously
(even for same Dict / Array)<br>
Dialog closes itself, when the relevant document is closed
\brief Dialog for adding items to Dictionaries or Arrays
*/
class AddItemDialog : public SelfDestructiveWidget {
Q_OBJECT
public:
~AddItemDialog();
static AddItemDialog* create(QWidget *parent,boost::shared_ptr<CDict> cont);
static AddItemDialog* create(QWidget *parent,boost::shared_ptr<CArray> cont);
public slots:
void itemDeleted(boost::shared_ptr<IProperty> it);
protected slots:
void posNumSet(bool on);
void posEndSet(bool on);
void buttonSelected(int id);
bool commit();
void commitClose();
protected:
void message(const QString &message);
void error(const QString &message);
AddItemDialog(QWidget *parent=0,const char *name=0);
void setItem(boost::shared_ptr<IProperty> it);
private:
/** Object (Dict or Array) into which any subitems will be added */
boost::shared_ptr<IProperty> item;
/** Array with properties */
Property* props[addDialogPropertyTypes];
/** Array with property names (selectors) */
QRadioButton* labels[addDialogPropertyTypes];
/** Frame containing controls to select name of new property (Dict) or end of array for appending (Array) */
QFrame *target;
/** Index of item that is selected for editing */
int selectedItem;
/** Name of new property, if adding to Dict */
QLineEdit *propertyName;
/** Adding to array? */
bool usingArray;
/** General layout of this widget */
QBoxLayout *layout;
/** Box holding buttons */
QFrame *qbox;
/** Group with content items */
Q_ButtonGroup *items;
/** Label used to show message */
QLabel *msg;
/** Settings used to save dialog position (dict/array) - this is useful, as these can have different sizes */
QString settingName;
/** Pdf document (for validating reference) */
CPdf* pdf;
/** Radiobutton for inserting at arbitrary position in array */
QRadioButton *posNum;
/** Radiobutton for appending at end of array */
QRadioButton *posEnd;
/** Edit box for editing array position at which the element should be inserted */
QLineEdit *arrayPos;
};
} // namespace gui
#endif

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks