dependencydlg.h

00001 
00002 // Name:        dependencydlg.h
00003 // Purpose:     wxPackageDependencyDlg definition
00004 // Author:      Francesco Montorsi
00005 // Modified by:
00006 // Created:     29/07/2006 09:48:04
00007 // RCS-ID:      $Id: dependencydlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
00008 // Copyright:   (c) 2006 Francesco Montorsi
00009 // Licence:     wxWidgets license
00011 
00012 #ifndef _DEPENDENCYDLG_H_
00013 #define _DEPENDENCYDLG_H_
00014 
00019 #include "wxp/packagedep.h"
00020 
00021 
00026 class wxPackageDownloadQueuePanel;
00027 
00028 
00033 
00034 #define SYMBOL_WXPACKAGEDEPENDENCYDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00035 #define SYMBOL_WXPACKAGEDEPENDENCYDLG_TITLE _("Package dependencies")
00036 #define SYMBOL_WXPACKAGEDEPENDENCYDLG_IDNAME wxID_ANY
00037 #define SYMBOL_WXPACKAGEDEPENDENCYDLG_SIZE wxSize(400, 300)
00038 #define SYMBOL_WXPACKAGEDEPENDENCYDLG_POSITION wxDefaultPosition
00039 #define ID_DEPENDENCY_REQUIRED_LIST 10060
00040 #define ID_DEPENDENCY_SUGGESTED_LIST 10061
00041 #define ID_DEPENDENCY_NOTINREPO 10064
00043 
00044 
00045 // ----------------------------------------------------------------------------
00046 // wxPackageDependencyDlg
00047 // ----------------------------------------------------------------------------
00048 
00049 class wxPackageDependencyDlg: public wxDialog
00050 {
00051     DECLARE_DYNAMIC_CLASS( wxPackageDependencyDlg )
00052     DECLARE_EVENT_TABLE()
00053 
00054 public:
00056     wxPackageDependencyDlg( );
00057 
00058     // NO CREATION IS PROVIDED THROUGH CONSTRUCTORS ON PURPOSE;
00059     // THIS BECAUSE YOU MUST CALL SetPackageArray() BEFORE Create() !
00060 
00062     bool Create( wxWindow* parent,
00063                  wxWindowID id = SYMBOL_WXPACKAGEDEPENDENCYDLG_IDNAME,
00064                  const wxString& caption = SYMBOL_WXPACKAGEDEPENDENCYDLG_TITLE,
00065                  const wxPoint& pos = SYMBOL_WXPACKAGEDEPENDENCYDLG_POSITION,
00066                  const wxSize& size = SYMBOL_WXPACKAGEDEPENDENCYDLG_SIZE,
00067                  long style = SYMBOL_WXPACKAGEDEPENDENCYDLG_STYLE );
00068 
00070     void CreateControls();
00071 
00073     static bool ShowToolTips();
00074 
00075 public:     // event handlers
00076 
00077     void OnButton(wxCommandEvent &ev);
00078 
00079 
00080 public:     // public API
00081 
00082     // must be called *before* Create() !
00083     bool SetPackageArray(const wxPackageArray &arr,
00084                          const wxPackageArray &installed,
00085                          const wxPackageArray &remote);
00086     bool SetPackage(const wxPackage &pkg,
00087                     const wxPackageArray &installed,
00088                     const wxPackageArray &remote);
00089 
00090     bool IsEmpty() const
00091         { return m_required.IsEmpty() && m_suggested.IsEmpty() && m_notfound.IsEmpty(); }
00092 
00093     // to call to retrieve data:
00094 
00095     void QueueAdditionalPackages(wxPackageDependencyType type,
00096                                  wxPackageDownloadQueuePanel *panel);
00097 
00101     wxPackageArray GetAdditionalPackages(wxPackageDependencyType t = wxPDT_INVALID) const;
00102 
00103 
00104 protected:          // internal utils
00105 
00106     void FillListbox(wxListBox *box, const wxPackageDependencyArray &arr,
00107                      bool useversionrange = false);
00108 
00109     wxPackageArray GetPackagesFromCheckListbox(wxCheckListBox *box,
00110                                                const wxPackageDependencyArray &arr) const;
00111 protected:      // controls
00112 
00113     wxStaticText* m_pMainMsg;
00114     wxCheckListBox* m_pRequiredCheckList;
00115     wxCheckListBox* m_pSuggestedCheckList;
00116     wxListBox* m_pNotFoundList;
00117     wxStaticText* m_pQuestionMsg;
00118 
00119 protected:
00120 
00121     // the dependencies
00122     wxPackageDependencyArray m_required, m_suggested, m_notfound;
00123 
00124     // a pointer to remote array of packages given to SetPackage*() function
00125     const wxPackageArray *m_pRemote;
00126 
00127     // true if the packages given to SetPackage*() functions
00128     // were all packages already downloaded, false otherwise.
00129     bool m_bSelectedPackagesAreDownloaded;
00130 };
00131 
00132 #endif
00133     // _DEPENDENCYDLG_H_

Generated on Thu Feb 1 22:14:30 2007 for wxWidgets Package Manager by  doxygen 1.5.1-p1