VR-Forces 4.0.4 Class Documentation
include/tmEventHandler/fileDialogHandler.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: fileDialogHandler.h,v $ $Revision: 1.7 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef FILEDIALOGHANDLER_H_
00013 #define FILEDIALOGHANDLER_H_
00014 
00015 #include "tmqt/eventHandler.h"
00016 #include "tmqt/eventSignaller.h"
00017 
00018 #ifdef WIN32
00019 #include <QtCore/QTimer>
00020 #endif
00021 
00022 class QFileDialog;
00023 
00024 #include "tmEventHandler/tmEventHandlerDefines.h"
00025 class DT_DLL_tmEventHandler DtFileDialogHandler : public DtEventHandler
00026 {
00027    Q_OBJECT
00028    
00029 public:
00030 
00032    DtFileDialogHandler();
00033    
00035    virtual ~DtFileDialogHandler();
00036 
00037 public:
00038    bool accepted() const;
00039 
00041    const QString& filename() const;
00042 
00045    const QString& startingDirectory() const;
00046    void setStartingDirectory(const QString&);
00047 
00049    const QString& selectedFilter() const;
00050    void setSelectedFilter(const QString&);
00051 
00052    virtual QWidget* createDialog(QWidget* parent);
00053    virtual QWidget* createOpenDialog(QWidget* parent);
00054    virtual void initFileDialog(QFileDialog*);
00055 
00056    virtual void showDialog(bool b);
00057 
00059    void setChooseOnly(bool b);
00060 
00061 protected:
00064    virtual QString createFilterList() = 0;
00065 
00070    virtual void accept();
00071 
00073    virtual void cancel();
00074 
00075    virtual bool completeOpen() = 0;
00076 
00077    virtual const char* eventSignalName() { return DtFileOpenDialogWidgetEvent; };
00078 
00079 private slots:
00080    void performThreadCheck();
00081 
00082 protected:
00083    bool myAccepted;
00084    QString myFilename;
00085    QString myStartingDirectory;
00086    bool myChooseOnly;
00087    QString mySelectedFilter;
00088 #ifdef WIN32
00089    QTimer myThreadCheckTimer;
00090    QVector<DWORD>   myThreadIds;
00091 #endif
00092 };
00093 
00094 inline bool DtFileDialogHandler::accepted() const
00095 {
00096    return myAccepted;
00097 }
00098 
00099 inline const QString& DtFileDialogHandler::filename() const
00100 {
00101    return myFilename;
00102 }
00103 
00104 inline const QString& DtFileDialogHandler::startingDirectory() const
00105 {
00106    return myStartingDirectory;
00107 }
00108 
00109 inline void DtFileDialogHandler::setStartingDirectory(const QString& s)
00110 {
00111    myStartingDirectory = s;
00112 }
00113 
00114 inline const QString& DtFileDialogHandler::selectedFilter() const
00115 {
00116    return mySelectedFilter;
00117 }
00118  
00119 inline void DtFileDialogHandler::setSelectedFilter(const QString& s)
00120 {
00121    mySelectedFilter = s;
00122 }
00123  
00124 inline void DtFileDialogHandler::setChooseOnly(bool b)
00125 {
00126    myChooseOnly = b;
00127 }
00128 
00129 #endif //FILEDIALOGHANDLER_H_
00130 
00131 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)