INTEGRATION: CWS visibility03 (1.1.2); FILE ADDED

2005/03/24 16:44:10 mhu 1.1.2.1: #i45006# Factored out and moved from svtools/source/filepicker/
This commit is contained in:
Oliver Bolte 2005-04-13 07:56:12 +00:00
parent dccac9f60b
commit 6f353f639e
2 changed files with 509 additions and 0 deletions

View file

@ -0,0 +1,387 @@
/*************************************************************************
*
* $RCSfile: iodlgimp.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: obo $ $Date: 2005-04-13 08:55:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
#ifndef _IODLGIMP_HXX
#define _IODLGIMP_HXX
#ifndef _STRING_HXX
#include <tools/string.hxx>
#endif
#ifndef _SV_FIXED_HXX
#include <vcl/fixed.hxx>
#endif
#ifndef _SV_LSTBOX_HXX
#include <vcl/lstbox.hxx>
#endif
#ifndef _SV_MENUBTN_HXX
#include <vcl/menubtn.hxx>
#endif
#ifndef _SV_TIMER_HXX
#include <vcl/timer.hxx>
#endif
#ifndef _SV_GROUP_HXX
#include <vcl/group.hxx>
#endif
#include "svtools/svarray.hxx"
#include <vector>
//*****************************************************************************
class Accelerator;
class CheckBox;
class SvtFileDialog;
class SvStringsDtor;
class SvUShorts;
//*****************************************************************************
#define FILEDIALOG_DEF_EXTSEP ';'
#define FILEDIALOG_DEF_WILDCARD '*'
#define FILEDIALOG_DEF_IMAGEBORDER 10
#define FILEDIALOG_DEF_TIMEOUT 250
//*****************************************************************************
String GetRegularExpression_Impl( const String& rFilter );
//*****************************************************************************
// SvtFileDialogFilter_Impl
//*****************************************************************************
/* [Beschreibung]
Instanzen dieser Klasse repr"asentieren einen Filter
*/
class SvtFileDialogFilter_Impl
{
private:
String m_aName; // name of the entry
String m_aType; // filter wildcard - if empty, the entry marks a group
public:
SvtFileDialogFilter_Impl( const String& rName, const String& rType );
~SvtFileDialogFilter_Impl();
const String& GetName() const { return m_aName; }
const String& GetType() const { return m_aType; }
sal_Bool isGroupSeparator() const { return 0 == m_aType.Len(); }
};
//*****************************************************************************
// SvtFileDialogFilterList_Impl
//*****************************************************************************
SV_DECL_PTRARR_DEL( SvtFileDialogFilterList_Impl, SvtFileDialogFilter_Impl*, 3, 3 );
//*****************************************************************************
// SvtFileDlgMode
//*****************************************************************************
enum SvtFileDlgMode
{
FILEDLG_MODE_OPEN = 0,
FILEDLG_MODE_SAVE = 1
};
//*****************************************************************************
// SvtFileDlgType
//*****************************************************************************
enum SvtFileDlgType
{
FILEDLG_TYPE_FILEDLG = 0,
FILEDLG_TYPE_PATHDLG
};
//*****************************************************************************
// SvtFileDialogURLSelector
//*****************************************************************************
class SvtFileDialogURLSelector : public MenuButton
{
private:
SvtFileDialog* m_pParent;
PopupMenu* m_pMenu;
protected:
// inline const SvtFileDialog* GetParent() const { return _pParent; }
inline SvtFileDialog* GetParent() { return m_pParent; }
protected:
void OpenURL( const String& rURL );
virtual void FillURLMenu( PopupMenu* _pMenu ) = 0;
protected:
SvtFileDialogURLSelector( SvtFileDialog* _pParent, const ResId& _rResId, sal_uInt16 _nButtonId );
~SvtFileDialogURLSelector();
virtual void Activate();
};
//*****************************************************************************
// SvtUpButton_Impl
//*****************************************************************************
class SvtUpButton_Impl : public SvtFileDialogURLSelector
{
private:
SvStringsDtor* _pURLs;
public:
SvtUpButton_Impl( SvtFileDialog* pParent, const ResId& rResId );
~SvtUpButton_Impl();
protected:
virtual void FillURLMenu( PopupMenu* _pMenu );
virtual void Select();
virtual void Click();
};
//*****************************************************************************
// SvtTravelButton_Impl
//*****************************************************************************
class SvtTravelButton_Impl : public SvtFileDialogURLSelector
{
private:
::std::vector< String > m_aFavourites;
public:
SvtTravelButton_Impl( SvtFileDialog* pParent, const ResId& rResId );
~SvtTravelButton_Impl();
void SetFavouriteLocations( const ::std::vector< String >& _rLocations );
protected:
virtual void FillURLMenu( PopupMenu* _pMenu );
virtual void Select();
virtual void Click();
};
//*****************************************************************************
// SvtFileDlgState
//*****************************************************************************
typedef sal_uInt8 SvtFileDlgState;
#define FILEDLG_STATE_NONE ((SvtFileDlgState)0x00)
#define FILEDLG_STATE_REMOTE ((SvtFileDlgState)0x01)
//*****************************************************************************
// SvtExpFileDlg_Impl
//*****************************************************************************
class SvtURLBox;
class SvtExpFileDlg_Impl
{
private:
DECL_STATIC_LINK( SvtExpFileDlg_Impl, UnClickHdl, Button* );
private:
ListBox* _pLbFilter;
const SvtFileDialogFilter_Impl* _pCurFilter;
String m_sCurrentFilterDisplayName; // may differ from _pCurFilter->GetName in case it is a cached entry
public:
SvtFileDialogFilterList_Impl* _pFilter;
SvtFileDialogFilter_Impl* _pUserFilter;
FixedText* _pFtFileName;
SvtURLBox* _pEdFileName;
FixedText* _pFtFileVersion;
ListBox* _pLbFileVersion;
FixedText* _pFtTemplates;
ListBox* _pLbTemplates;
FixedText* _pFtImageTemplates;
ListBox* _pLbImageTemplates;
FixedText* _pFtFileType;
PushButton* _pBtnFileOpen;
PushButton* _pBtnCancel;
HelpButton* _pBtnHelp;
SvtUpButton_Impl* _pBtnUp;
ImageButton* _pBtnNewFolder;
SvtTravelButton_Impl* _pBtnStandard;
CheckBox* _pCbPassword;
FixedText* _pFtCurrentPath;
CheckBox* _pCbAutoExtension;
CheckBox* _pCbOptions;
SvtFileDlgMode _eMode;
SvtFileDlgType _eDlgType;
SvtFileDlgState _nState;
WinBits _nStyle;
String _aStdDir;
// beim traveln der Filterbox erst Zeitversetzt filtern
Timer _aFilterTimer;
// Zeigt der OpenHdl_Imp(), ob das Open durch einen Doppelclick ausgel"ost wurde
sal_Bool _bDoubleClick;
sal_Bool m_bNeedDelayedFilterExecute;
// Liste mit den 5 zuletzt genutzten Filtern
// Defaultfilter fuer <Alle> oder <Alle ...>
const SvtFileDialogFilter_Impl* _pDefaultFilter;
// Multiselektion?
sal_Bool _bMultiSelection;
// Fixgr"ossen f"ur Resize merken
long _nFixDeltaHeight;
Size _a6Size;
Size _aDlgSize;
String _aIniKey;
sal_Bool _bFolderHasOpened;
SvtExpFileDlg_Impl( WinBits nBits );
~SvtExpFileDlg_Impl();
void SetStandardDir( const String& _rDir );
inline const String& GetStandardDir() const { return _aStdDir; }
inline void DisableFilterBoxAutoWidth() { _pLbFilter->EnableDDAutoWidth( FALSE ); }
// ------------------------------------------
// access to the filter listbox only as Control* - we want to maintain the entries/userdata ourself
Control* GetFilterListControl() { return _pLbFilter; }
const Control* GetFilterListControl() const { return _pLbFilter; }
void CreateFilterListControl( Window* _pParent, const ResId& _rId );
inline void SetFilterListSelectHdl( const Link& _rHandler );
// inits the listbox for the filters from the filter list (_pFilter)
void ClearFilterList( );
void InitFilterList( );
inline sal_Bool HasFilterListEntry( const String& _rFilterName );
inline void SelectFilterListEntry( const String& _rFilterName );
inline void SetNoFilterListSelection( );
void InsertFilterListEntry( const SvtFileDialogFilter_Impl* _pFilterDesc );
// _pFilterDesc must already have been added to _pFilter
inline SvtFileDialogFilter_Impl* GetSelectedFilterEntry( String& /* [out] */ _rDisplayName ) const;
inline sal_Bool IsFilterListTravelSelect() const;
SvtFileDialogFilter_Impl* FindFilter( const String& _rFilterName );
// ------------------------------------------
// access to the current filter via methods only - need to care for consistency between _pCurFilter and m_sCurrentFilterDisplayName
inline const SvtFileDialogFilter_Impl* GetCurFilter( ) const;
inline const String& GetCurFilterDisplayName() const;
void SetCurFilter( SvtFileDialogFilter_Impl* _pFilter, const String& _rDisplayName );
inline void SetCurFilter( SvtFileDialogFilter_Impl* _pFilter );
};
inline void SvtExpFileDlg_Impl::SetFilterListSelectHdl( const Link& _rHandler )
{
_pLbFilter->SetSelectHdl( _rHandler );
}
inline sal_Bool SvtExpFileDlg_Impl::HasFilterListEntry( const String& _rFilterName )
{
return ( LISTBOX_ENTRY_NOTFOUND != _pLbFilter->GetEntryPos( _rFilterName ) );
}
inline void SvtExpFileDlg_Impl::SelectFilterListEntry( const String& _rFilterName )
{
_pLbFilter->SelectEntry( _rFilterName );
}
inline void SvtExpFileDlg_Impl::SetNoFilterListSelection( )
{
_pLbFilter->SetNoSelection( );
}
inline SvtFileDialogFilter_Impl* SvtExpFileDlg_Impl::GetSelectedFilterEntry( String& _rDisplayName ) const
{
_rDisplayName = _pLbFilter->GetSelectEntry();
return static_cast< SvtFileDialogFilter_Impl* >( _pLbFilter->GetEntryData ( _pLbFilter->GetSelectEntryPos() ) );
}
inline sal_Bool SvtExpFileDlg_Impl::IsFilterListTravelSelect() const
{
return _pLbFilter->IsTravelSelect();
}
inline const SvtFileDialogFilter_Impl* SvtExpFileDlg_Impl::GetCurFilter( ) const
{
return _pCurFilter;
}
inline const String& SvtExpFileDlg_Impl::GetCurFilterDisplayName() const
{
return m_sCurrentFilterDisplayName;
}
inline void SvtExpFileDlg_Impl::SetCurFilter( SvtFileDialogFilter_Impl* pFilter )
{
SetCurFilter( pFilter, pFilter->GetName() );
}
#endif // #ifndef _IODLGIMP_HXX

View file

@ -0,0 +1,122 @@
#*************************************************************************
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.2 $
#
# last change: $Author: obo $ $Date: 2005-04-13 08:56:12 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
#
#*************************************************************************
PRJ=..$/..
PRJNAME=fpicker
TARGET=fps_office
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
GEN_HID=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
DLLPRE=
# --- Files --------------------------------------------------------
SLOFILES=\
$(SLO)$/asyncfilepicker.obj \
$(SLO)$/commonpicker.obj \
$(SLO)$/OfficeControlAccess.obj \
$(SLO)$/OfficeFilePicker.obj \
$(SLO)$/OfficeFolderPicker.obj \
$(SLO)$/fpinteraction.obj \
$(SLO)$/fpsmartcontent.obj \
$(SLO)$/fps_office.obj \
$(SLO)$/iodlg.obj \
$(SLO)$/iodlgimp.obj
SHL1TARGET= $(TARGET).uno
SHL1IMPLIB= i$(TARGET)
SHL1OBJS= $(SLOFILES)
SHL1STDLIBS=\
$(SVTOOLLIB) \
$(TKLIB) \
$(VCLLIB) \
$(SVLLIB) \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB)
SHL1VERSIONMAP=exports.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
SRS1NAME= $(TARGET)
SRC1FILES= \
OfficeFilePicker.src \
iodlg.src
RESLIB1NAME=$(TARGET)
RESLIB1IMAGES=$(PRJ)$/res
RESLIB1SRSFILES=\
$(SRS)$/fps_office.srs
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk