/*************************************************************************** tagdialog.h - description ------------------- begin : Sat Apr 1 2000 copyright : (C) 2000 by Yacovlev Alexander & Dmitry Poplavsky (C) 2002-2003 by Andras Mantia ***************************************************************************/ /*************************************************************************** * * * 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, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TAGDIALOG_H #define TAGDIALOG_H #include #include #include #include #include "resource.h" /**class for insert/edit tags *@author Yacovlev Alexander & Dmitry Poplavsky & Andras Mantia */ class Document; class TagWidget; class Tagxml; class TQTag; class Tag; class KURL; class TQShowEvent; class TagDialog : public TQTabDialog { Q_OBJECT TQ_OBJECT public: /** constructor: edit tag if "tag" == 0L or insert new tag if tag != 0L attr format: "attr1='value1' attr2='value2'..." insertInLine : true : false: */ TagDialog(TQTag* dtdTag, Tag* tag, KURL a_baseURL = KURL()); TagDialog(TQTag* dtdTag, Tag* tag, const TQString& selection, KURL a_baseURL = KURL()); TagDialog(TQTag* dtdTag, TQString attrs=TQString(), KURL a_baseURL = KURL()); TagDialog(TQTag* dtdTag, const TQString& selection, TQString attrs=TQString(), KURL a_baseURL = KURL()); ~TagDialog(); /** Insert an attribute to dict*/ void insertAttribute(TQString *attr, TQString *value); /** */ void parseTag(); /** returen doc path */ KURL baseURL(); /** Return the attributes in TQDict format*/ TQDict * getAttributes(); /** Return all the attributes in one string*/ TQString getAttributeString(); /**Return the value of the attribute specified by attr. */ TQString getAttribute(const TQString& attr); /** Insert the new tag into the Document*/ void insertTag(Document *w, bool insertInLine = true); /** build and return the new Node.*/ Node *buildNode(Document *w); public: TQWidget *mainDlg; TQDict *dict; KURL m_baseURL; public slots: // Public slots void slotAccept(); protected slots: virtual void showEvent(TQShowEvent *ev); private: bool deleteTag; Tag *m_tag; TQTag* dtdTag; TQString m_selection; TQPtrList *extraPageList; void init(TQTag* dtdTag, KURL a_baseURL); void parseAttributes(const TQString &attrs); }; #endif