Kaydet (Commit) 0789c3d9 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS aquafilepicker02_DEV300 (1.2.40); FILE MERGED

2008/02/14 17:28:45 fheckl 1.2.40.3: Further changes concerning Autoextension
2008/01/14 08:23:23 fheckl 1.2.40.2: Code cleanup and some implementation details
2008/01/02 18:25:58 fheckl 1.2.40.1: issue #80399 more Cocoa
üst 14bc62ad
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: ControlHelper.hxx,v $ * $RCSfile: ControlHelper.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: ihi $ $Date: 2007-07-11 10:57:54 $ * last change: $Author: kz $ $Date: 2008-03-05 16:35:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -36,23 +36,33 @@ ...@@ -36,23 +36,33 @@
#ifndef _CONTROLHELPER_HXX_ #ifndef _CONTROLHELPER_HXX_
#define _CONTROLHELPER_HXX_ #define _CONTROLHELPER_HXX_
#ifndef _RTL_USTRING_H_ #ifndef _RTL_USTRING_HXX_
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#endif #endif
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ #ifndef _COM_SUN_STAR_UNO_ANY_HXX_
#include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Any.hxx>
#endif #endif
#include <list> #include <list>
#include <map>
#include <premac.h> #include <premac.h>
#include <Carbon/Carbon.h> #include <Cocoa/Cocoa.h>
#include <postmac.h> #include <postmac.h>
#ifndef _SALAQUACONSTANTS_H_ #ifndef _SALAQUACONSTANTS_H_
#include "SalAquaConstants.h" #include "SalAquaConstants.h"
#endif #endif
#ifndef _FILTERHELPER_HXX_
#include "FilterHelper.hxx"
#endif
#ifndef _AQUAFILEPICKERDELEGATE_HXX_
#include "AquaFilePickerDelegate.hxx"
#endif
using namespace com::sun::star; using namespace com::sun::star;
using namespace rtl; using namespace rtl;
...@@ -69,35 +79,25 @@ public: ...@@ -69,35 +79,25 @@ public:
//------------------------------------------------ //------------------------------------------------
// XInitialization delegate // XInitialization delegate
//------------------------------------------------ //------------------------------------------------
void initialize(sal_Int16 templateId); void initialize( sal_Int16 templateId );
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// XFilePickerControlAccess function delegates // XFilePickerControlAccess function delegates
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any& rValue ); void setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any& rValue );
uno::Any getValue(sal_Int16 nControlId, sal_Int16 nControlAction); uno::Any getValue( sal_Int16 nControlId, sal_Int16 nControlAction ) const;
void enableControl(sal_Int16 nControlId, sal_Bool bEnable); void enableControl( sal_Int16 nControlId, sal_Bool bEnable ) const;
OUString getLabel(sal_Int16 nControlId); OUString getLabel( sal_Int16 nControlId );
void setLabel( sal_Int16 nControlId, const CFStringRef aLabel ); void setLabel( sal_Int16 nControlId, const NSString* aLabel );
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// NavigationServices callback delegates // other stuff
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void handleStart(NavCBRecPtr callBackParms); void updateFilterUI();
void handleCustomize(NavCBRecPtr callBackParms);
void handleEvent(NavCBRecPtr callBackParms, NavEventCallbackMessage aLatestEvent);
void handleAdjustRect(NavCBRecPtr callBackParms);
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Type definitions // Type definitions
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
enum ControlType {
NONE
, CHECKBOX
, POPUPMENU
, USERPANE
};
enum ToggleType { enum ToggleType {
AUTOEXTENSION, //but autoextension is handled differently on MacOSX AUTOEXTENSION, //but autoextension is handled differently on MacOSX
PASSWORD, PASSWORD,
...@@ -119,58 +119,109 @@ public: ...@@ -119,58 +119,109 @@ public:
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// inline functions // inline functions
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
inline ControlRef getUserPane() { inline NSView* getUserPane() {
if (m_bIsUserPaneLaidOut == false) {
createUserPane();
}
return m_pUserPane; return m_pUserPane;
} }
inline bool getVisibility(ToggleType tToggle) { inline bool getVisibility(ToggleType tToggle) {
return m_bToggleVisibility[tToggle]; return m_bToggleVisibility[tToggle];
} }
inline void setPopupPresent(bool bPresent) { inline void setFilterControlNeeded(bool bNeeded) {
m_bIsFilterPopupPresent = bPresent; m_bIsFilterControlNeeded = bNeeded;
if (bNeeded == true) {
m_bUserPaneNeeded = true;
}
}
inline void setFilterHelper(FilterHelper* pFilterHelper) {
m_pFilterHelper = pFilterHelper;
}
inline void setFilePickerDelegate(AquaFilePickerDelegate* pDelegate) {
m_pDelegate = pDelegate;
}
inline bool isAutoExtensionEnabled() {
return m_bAutoFilenameExtension;
} }
private: private:
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// private member variables // private member variables
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
ControlRef m_pUserPane;
int m_nLastCustomizeTryWidth; /** the native view object */
int m_nLastCustomizeTryHeight; NSView* m_pUserPane;
/** the checkbox controls */
NSControl* m_pToggles[ TOGGLE_LAST ];
ControlRef m_pToggles[ TOGGLE_LAST ]; /** the visibility flags for the checkboxes */
bool m_bToggleVisibility[TOGGLE_LAST]; bool m_bToggleVisibility[TOGGLE_LAST];
// enum tButtonType { /** the special filter control */
// PLAY, NSPopUpButton *m_pFilterControl;
// BUTTON_LAST
// }; /** the popup menu controls (except for the filter control) */
// NSControl* m_pListControls[ LIST_LAST ];
// ControlRef m_pButtons[ BUTTON_LAST ];
/** a map to store a control's label text */
::std::map<NSControl *, NSString *> m_aMapListLabels;
/** a map to store a popup menu's label text field */
::std::map<NSPopUpButton *, NSTextField *> m_aMapListLabelFields;
ControlRef m_pListControls[ LIST_LAST ]; /** the visibility flags for the popup menus */
bool m_bListVisibility[ LIST_LAST ]; bool m_bListVisibility[ LIST_LAST ];
/** indicates if a user pane is needed */
bool m_bUserPaneNeeded; bool m_bUserPaneNeeded;
::std::list<ControlRef> m_aActiveControls; /** indicates if the user pane was laid out already */
bool m_bIsUserPaneLaidOut;
bool m_bIsFilterPopupPresent; /** indicates if a filter control is needed */
bool m_bIsFilterControlNeeded;
/*
* With issue #78852 the GUI option to set automatic filename extension was removed but
* so far the setting is still in effect and so the value for has to be saved and possibly be restored
* also.
* But with issue #FILLME users were starting to get confused on Windows so we decided to have
* autoextension always on and have it selectable for the user again.
*/
/** indicates if a filename extension is to automatically be appended to a user entered file name */
bool m_bAutoFilenameExtension;
/** a list with all actively used controls */
::std::list<NSControl*> m_aActiveControls;
/** the filter helper */
FilterHelper *m_pFilterHelper;
/** the save or open panel's delegate */
AquaFilePickerDelegate *m_pDelegate;
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// private methods // private methods
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void HandleSetListValue(const ControlRef pControl, const sal_Int16 nControlAction, const uno::Any& rValue); void HandleSetListValue(const NSControl* pControl, const sal_Int16 nControlAction, const uno::Any& rValue);
uno::Any HandleGetListValue(const ControlRef pControl, const sal_Int16 nControlAction) const; uno::Any HandleGetListValue(const NSControl* pControl, const sal_Int16 nControlAction) const;
void createControls();
void createFilterControl();
void createUserPane();
NSTextField* createLabelWithString(const NSString* label);
void createControls(); int getControlElementName(const Class clazz, const int nControlId) const;
void createUserPane(WindowRef parent); NSControl* getControl( const sal_Int16 nControlId ) const;
int getControlElementName(ControlType type, int nControlId); static int getVerticalDistance(const NSControl* first, const NSControl* second);
ControlRef getControl( const sal_Int16 nControlId );
void layoutControls(); void layoutControls();
}; };
#endif //_CONTROLHELPER_HXX_ #endif //_CONTROLHELPER_HXX_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment