TaskSelectLinkProperty.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2009 Jürgen Riegel <juergen.riegel@web.de>              *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_TASKVIEW_TaskSelectLinkProperty_H
00025 #define GUI_TASKVIEW_TaskSelectLinkProperty_H
00026 
00027 #include "TaskView.h"
00028 #include <Gui/Selection.h>
00029 #include <boost/signals.hpp>
00030 #include <App/PropertyLinks.h>
00031 
00032 
00033 class Ui_TaskSelectLinkProperty;
00034 
00035 namespace App {
00036 class Property;
00037 }
00038 
00039 namespace Gui {
00040 class ViewProvider;
00041 namespace TaskView {
00042 
00055 class GuiExport TaskSelectLinkProperty : public TaskBox, public Gui::SelectionSingleton::ObserverType
00056 {
00057     Q_OBJECT
00058 
00059 public:
00060     TaskSelectLinkProperty(const char *,App::Property *,QWidget *parent = 0);
00061     ~TaskSelectLinkProperty();
00063     void OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
00064                   Gui::SelectionSingleton::MessageType Reason);
00065 
00067     bool setFilter(const char*);
00068 
00070     void activate(void);
00071 
00073     bool accept(void);
00075     bool reject(void);
00077     void sendSelection2Property(void);
00079     inline bool isSelectionValid(void) const {return Filter->match();}
00080 
00081 private Q_SLOTS:
00082     void on_Remove_clicked(bool);
00083     void on_Add_clicked(bool);
00084     void on_Invert_clicked(bool);
00085     void on_Help_clicked(bool);
00086 
00087 Q_SIGNALS:
00088     void emitSelectionFit(void);
00089     void emitSelectionMisfit(void);
00090 
00091 protected:
00092     void changeEvent(QEvent *e);
00093 
00094 private:
00095     // checks for selection and set background color and signals
00096     void checkSelectionStatus(void);
00097 
00098     QWidget* proxy;
00099     Ui_TaskSelectLinkProperty* ui;
00100 
00101     // selection filter for the session 
00102     Gui::SelectionFilter *Filter;
00103 
00104     // posible used propetry types, only one is used
00105     App::PropertyLinkSub  *LinkSub;
00106     App::PropertyLinkList *LinkList;
00107 
00108     // string stores the Property at the beginning (for Cancel)
00109     std::vector<std::string> StartValueBuffer;
00110     App::DocumentObject      *StartObject;
00111 };
00112 
00113 } //namespace TaskView
00114 } //namespace Gui
00115 
00116 #endif // GUI_TASKVIEW_TASKAPPERANCE_H

Generated on Wed Nov 23 19:00:44 2011 for FreeCAD by  doxygen 1.6.1