Kaydet (Commit) 6a593fde authored tarafından Tino Rachui's avatar Tino Rachui

moved from sysui because of cyclic build dependencies

üst e8278ac5
fp fpicker : xml2cmp drafts rdbmaker svtools NULL
fp fpicker\source\win32\filepicker nmake - w fp_win32_filepicker NULL
fp fpicker\source\win32\folderpicker nmake - w fp_win32_folderpicker NULL
fp fpicker\source\win32\misc nmake - w fp_win32_misc fp_win32_filepicker fp_win32_folderpicker NULL
fp fpicker\util nmake - all fp_util fp_win32_filepicker fp_win32_misc fp_win32_folderpicker NULL
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml
/*************************************************************************
*
* $RCSfile: FPServiceInfo.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
*
* 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 _FPSERVICEINFO_HXX_
#define _FPSERVICEINFO_HXX_
//------------------------------------------------------------------------
// defines
//------------------------------------------------------------------------
// the service name is a description of a set of
// interfaces (is the same as component categories in COM)
#define TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID 1000
#define TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID 1001
#define TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID 2000
#define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID 2001
#define TMPL95_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID 3000
#define TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID 3001
#define TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4000
#define TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4001
#define TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5000
#define TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5001
#define TMPL95_PLAY_PUSHBUTTON 6000
#define TMPL2000_PLAY_PUSHBUTTON 6001
#define TMPL95_AUTOEXT_SELECTION_BOX 7000
#define TMPL2000_AUTOEXT_SELECTION_BOX 7001
#define TMPL95_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID 8000
#define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID 8001
// the service names
#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.SystemFilePicker"
// the implementation names
#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.Win32FilePicker"
// the registry key names
// a key under which this service will be registered, Format: -> "/ImplName/UNO/SERVICES/ServiceName"
// < Implementation-Name ></UNO/SERVICES/>< Service-Name >
#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.Win32FilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.SystemFilePicker"
#endif
/*************************************************************************
*
* $RCSfile: FPentry.cxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:15 $
*
* 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): _______________________________________
*
*
************************************************************************/
//----------------------------------------------
// includes of other projects
//----------------------------------------------
#ifndef _CPPUHELPER_FACTORY_HXX_
#include <cppuhelper/factory.hxx>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
#include <com/sun/star/container/XSet.hpp>
#endif
#ifndef _OSL_DIAGNOSE_H_
#include <osl/diagnose.h>
#endif
#ifndef _FILEPICKER_HXX_
#include "FilePicker.hxx"
#endif
#ifndef _FPSERVICEINFO_HXX_
#include "FPServiceInfo.hxx"
#endif
//-----------------------------------------------
// namespace directives
//-----------------------------------------------
using namespace ::rtl ;
using namespace ::com::sun::star::uno ;
using namespace ::com::sun::star::container ;
using namespace ::com::sun::star::lang ;
using namespace ::com::sun::star::registry ;
using namespace ::cppu ;
using ::com::sun::star::ui::dialogs::XFilePicker;
//------------------------------------------------
//
//------------------------------------------------
static Reference< XInterface > SAL_CALL createInstance(
const Reference< XMultiServiceFactory >& rServiceManager )
{
return Reference< XInterface >(
static_cast< XFilePicker* >(
new CFilePicker( rServiceManager ) ) );
}
//------------------------------------------------
// the three uno functions that will be exported
//------------------------------------------------
extern "C"
{
//------------------------------------------------
// component_getImplementationEnvironment
//------------------------------------------------
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//------------------------------------------------
//
//------------------------------------------------
sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
{
sal_Bool bRetVal = sal_True;
if ( pRegistryKey )
{
try
{
Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
}
catch( InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
bRetVal = sal_False;
}
}
return bRetVal;
}
//------------------------------------------------
//
//------------------------------------------------
void* SAL_CALL component_getFactory(
const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
{
void* pRet = 0;
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );
Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
OUString::createFromAscii( pImplName ),
createInstance,
aSNS ) );
if ( xFactory.is() )
{
xFactory->acquire();
pRet = xFactory.get();
}
}
return pRet;
}
} // extern "C"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*************************************************************************
*
* $RCSfile: FilterContainer.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
*
* 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 _FILTER_CONTAINER_HXX_
#define _FILTER_CONTAINER_HXX_
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _RTL_USTRING_
#include <rtl/ustring>
#endif
#include <vector>
//------------------------------------------------------
// helper class, only useable by OFilterContainer
//------------------------------------------------------
class CFilterContainer
{
public:
// defines a filter entry which is made of a name and a filter value
// e.g. 'Text *.txt'
typedef std::pair< rtl::OUString, rtl::OUString > FILTER_ENTRY_T;
public:
explicit CFilterContainer( sal_Int32 initSize = 0 );
// add a new filter
// returns true if the filter was successfully added
// returns false if duplicates are not allowed and
// the filter is already in the container
sal_Bool SAL_CALL addFilter(
const ::rtl::OUString& aName,
const ::rtl::OUString& aFilter,
sal_Bool bAllowDuplicates = sal_False );
// delete the specified filter returns true on
// success and false if the filter was not found
sal_Bool SAL_CALL delFilter( const ::rtl::OUString& aName );
// the number of filter already added
sal_Int32 SAL_CALL numFilter( );
// clear all entries
void SAL_CALL empty( );
// retrieve a filter from the container both methods
// return true on success and false if the specified
// filter was not found
sal_Bool SAL_CALL getFilter( const ::rtl::OUString& aName, ::rtl::OUString& theFilter ) const;
sal_Bool SAL_CALL getFilter( sal_Int32 aIndex, ::rtl::OUString& theFilter ) const;
// returns the position of the specified filter or -1
// if the filter was not found
sal_Int32 SAL_CALL getFilterPos( const ::rtl::OUString& aName ) const;
// starts enumerating the filter in the container
void SAL_CALL beginEnumFilter( );
// returns true if another filter has been retrieved
sal_Bool SAL_CALL getNextFilter( FILTER_ENTRY_T& nextFilterEntry );
protected:
typedef std::vector< FILTER_ENTRY_T > FILTER_VECTOR_T;
private:
// prevent copy and assignment
CFilterContainer( const CFilterContainer& );
CFilterContainer& SAL_CALL operator=( const CFilterContainer& );
sal_Int32 SAL_CALL getFilterTagPos( const ::rtl::OUString& aName ) const;
private:
FILTER_VECTOR_T m_vFilters;
FILTER_VECTOR_T::const_iterator m_iter;
sal_Bool m_bIterInitialized;
};
//----------------------------------------------------------------
// a helper function to create a filter buffer in the format
// the Win32 API requires, e.g. "Text\0*.txt\0Doc\0*.doc;*xls\0\0"
//----------------------------------------------------------------
rtl::OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer );
#endif
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*************************************************************************
*
* $RCSfile: PreviewCtrl.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
*
* 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 _PREVIEWCTRL_HXX_
#define _PREVIEWCTRL_HXX_
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _RTL_USTRING_HXX_
#include <rtl/ustring.hxx>
#endif
#include <comdef.h>
#include <systools/win32/user9x.h>
#include <systools/win32/kernel9x.h>
#include <memory>
//---------------------------------------------
// declaration
//---------------------------------------------
class CDimension
{
public:
CDimension( ) :
m_cx( 0 ),
m_cy( 0 )
{
}
CDimension( sal_Int32 cx, sal_Int32 cy ) :
m_cx( cx ),
m_cy( cy )
{
}
sal_Int32 m_cx;
sal_Int32 m_cy;
};
//--------------------------------------------------
// we use OleInitialize here because we are calling
// some Ole functions to realize the picture preview
// and we expect to be called from the main thread
// so that there will be no problem calling
// OleInitialize (the main thread should be an STA)
// When OleInitialize should fail at worst the
// preview doesn't work
//--------------------------------------------------
class CAutoOleInit
{
public:
// used to communicate ole
// initialzation failures
class COleInitException { };
CAutoOleInit( )
{
HRESULT hr = OleInitialize( NULL );
if ( FAILED( hr ) )
throw COleInitException( );
}
~CAutoOleInit( )
{
OleUninitialize( );
}
};
//---------------------------------------------
// A simple file preview class to preview some
// common picture formats like *.gif, *jpg, etc.
// This class is not thread-safe and is
// implmented as singleton, because the class
// has only one static member to reconnect
// from callback functions
// we use a singleton-destroyer to get rid off
// the singleton instance, but this happens
// only on shutdown (unloading of the dll) -
// it's a question of taste (other solutions
// are possible)
//---------------------------------------------
class CFilePreview
{
public:
// to ensure only one instance (singleton)
static CFilePreview* createInstance(
HWND aParent,
POINT ulCorner,
const CDimension& aSize,
HINSTANCE hInstance,
sal_Bool bShow = sal_True,
sal_Bool bEnabled = sal_True );
// sets the size of the preview window
sal_Bool SAL_CALL setSize( const CDimension& aSize );
// returns the CDimension of the preview
sal_Bool SAL_CALL getSize( CDimension& theSize ) const;
// sets the position of the upper left corner
// of the preview window relative to the
// upper left corner of the parent window
sal_Bool SAL_CALL setPos( POINT ulCorner );
// returns the current position of the preview
// relative to the upper left corner of the
// parent window
sal_Bool SAL_CALL getPos( POINT& ulCorner ) const;
// enables or disables the preview window
// bEnable - true the window is enabled and updates its
// view when update is called
// bEnable - false the window shows itself in disabled
// mode and does not update its view when update is
// called
void SAL_CALL enable( sal_Bool bEnable );
// shows the preview window
// possible values see SHOW_STATE
sal_Bool SAL_CALL show( sal_Bool bShow );
// if the preview is shown and enabled
// preview of the given file will be shown
// returns true on success or false if an error
// occured (the file in not there or not accessible etc.)
virtual sal_Bool SAL_CALL update( const rtl::OUString& aFileName );
protected:
// clients can create instances only through the static create method
CFilePreview(
HWND aParent,
POINT ulCorner,
const CDimension& aSize,
HINSTANCE hInstance,
sal_Bool bShow = sal_True,
sal_Bool bEnabled = sal_True );
// only the singleton destroyer class is allowed to delete the
// singleton instance of this class
virtual ~CFilePreview( );
// we use the stl auto_ptr class as singleton destroyer
typedef std::auto_ptr< CFilePreview > FILEPREVIEW_SINGLETON_DESTROYER_T;
protected:
virtual void SAL_CALL onPaint( HWND hWnd, HDC hDC );
sal_Bool loadFile( const rtl::OUString& aFileName );
private:
CAutoOleInit m_autoOleInit;
POINT m_pt;
CDimension m_dim;
HWND m_hwnd;
sal_Bool m_bEnabled;
IPicturePtr m_IPicture;
ATOM m_atomPrevWndClass;
HINSTANCE m_hInstance;
static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static CFilePreview* s_FilePreviewInst;
static FILEPREVIEW_SINGLETON_DESTROYER_T s_SingletonDestroyer;
private:
friend FILEPREVIEW_SINGLETON_DESTROYER_T;
};
#endif
\ No newline at end of file
#include <windows.h>
#include <dlgs.h>
/*************************************************************************
*
* $RCSfile: controlaccess.cxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:15 $
*
* 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): _______________________________________
*
*
************************************************************************/
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
#ifndef _OSL_DIAGNOSE_H_
#include <osl/diagnose.h>
#endif
#ifndef _CONTROLACCESS_HXX_
#include "controlaccess.hxx"
#endif
#ifndef _WINIMPLHELPER_HXX_
#include "..\misc\WinImplHelper.hxx"
#endif
#include <systools/win32/user9x.h>
//------------------------------------------------------------
// we are using a table based algorithm to dispatch control
// actions there is one table containing one action table for
// each control class and one action table per control class
// which contains function pointer to control action functions
//------------------------------------------------------------
//------------------------------------------------------------
// namespace directives
//------------------------------------------------------------
using rtl::OUString;
namespace // private
{
//------------------------------------------------------------
// table setup
//------------------------------------------------------------
CTRL_SETVALUE_FUNCTION_T CheckboxSetValueFunctionTable[] =
{
CheckboxSetState
};
const size_t SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE =
sizeof( CheckboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T );
CTRL_GETVALUE_FUNCTION_T CheckboxGetValueFunctionTable[] =
{
CheckboxGetState
};
const size_t SIZE_CHECKBOX_GETVALUE_FUNCTION_TABLE =
sizeof( CheckboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T );
CTRL_SETVALUE_FUNCTION_T ListboxSetValueFunctionTable[] =
{
NULL,
ListboxAddItem,
ListboxAddItems,
ListboxDeleteItem,
ListboxDeleteItems,
ListboxSetSelectedItem
};
const size_t SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE =
sizeof( ListboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T );
CTRL_GETVALUE_FUNCTION_T ListboxGetValueFunctionTable[] =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
ListboxGetItems,
ListboxGetSelectedItem
};
const size_t SIZE_LISTBOX_GETVALUE_ACTION_TABLE =
sizeof( ListboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T );
struct _ENTRY
{
LPVOID lpFunctionTable;
size_t TableSize;
};
// an array of function tables, one for each control class
_ENTRY CtrlClassSetValueFunctionTable[] =
{
{ NULL, 0 },
{ CheckboxSetValueFunctionTable, SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE },
{ ListboxSetValueFunctionTable, SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE },
{ NULL, 0 }
};
// an array of function tables, one for each control class
_ENTRY CtrlClassGetValueFunctionTable[] =
{
{ NULL, 0 },
{ CheckboxGetValueFunctionTable, SIZE_CHECKBOX_GETVALUE_FUNCTION_TABLE },
{ ListboxGetValueFunctionTable, SIZE_LISTBOX_GETVALUE_ACTION_TABLE },
{ NULL, 0 }
};
//------------------------------------------------------------
//
//------------------------------------------------------------
CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction(
CTRL_SETVALUE_FUNCTION_T* aCtrlSetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction )
{
if ( !aCtrlSetValueFunctionTable ||
aCtrlAction < 0 || aCtrlAction >= aTableSize )
return NULL;
return aCtrlSetValueFunctionTable[aCtrlAction];
}
//------------------------------------------------------------
//
//------------------------------------------------------------
CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction(
CTRL_GETVALUE_FUNCTION_T* aCtrlGetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction )
{
if ( !aCtrlGetValueFunctionTable ||
aCtrlAction < 0 || aCtrlAction >= aTableSize )
return NULL;
return aCtrlGetValueFunctionTable[aCtrlAction];
}
//------------------------------------------------------------
//
//------------------------------------------------------------
inline
_ENTRY SAL_CALL GetCtrlClassSetValueFunctionTable( CTRL_CLASS aCtrlClass )
{
return CtrlClassSetValueFunctionTable[aCtrlClass];
}
//------------------------------------------------------------
//
//------------------------------------------------------------
inline
_ENTRY SAL_CALL GetCtrlClassGetValueFunctionTable( CTRL_CLASS aCtrlClass )
{
return CtrlClassGetValueFunctionTable[aCtrlClass];
}
int WindowsFileOpenCtrlIds[] =
{
0,
IDOK,
IDCANCEL,
cmb1
};
const SIZE_WINDOWS_FILEOPEN_CTRL_IDS =
sizeof( WindowsFileOpenCtrlIds ) / sizeof( int );
}; // end namespace
//------------------------------------------------------------
//
//------------------------------------------------------------
CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction )
{
_ENTRY aEntry =
GetCtrlClassSetValueFunctionTable( aCtrlClass );
return GetCtrlSetValueFunction(
reinterpret_cast< CTRL_SETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ),
aEntry.TableSize,
aCtrlAction );
}
//------------------------------------------------------------
//
//------------------------------------------------------------
CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction )
{
_ENTRY aEntry =
GetCtrlClassGetValueFunctionTable( aCtrlClass );
return GetCtrlGetValueFunction(
reinterpret_cast< CTRL_GETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ),
aEntry.TableSize,
aCtrlAction );
}
//------------------------------------------------------------
//
//------------------------------------------------------------
CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl )
{
CTRL_CLASS aCtrlClass = UNKNOWN;
char aClassName[256];
int nRet = GetClassNameA( hwndCtrl, aClassName, 256 );
if ( nRet )
{
if ( 0 == _stricmp( aClassName, "button" ) )
{
// button means many things so we have
// to find out what button it is
LONG lBtnStyle = GetWindowLong( hwndCtrl, GWL_STYLE );
if ( lBtnStyle & BS_CHECKBOX )
aCtrlClass = CHECKBOX;
else if ( (lBtnStyle & BS_PUSHBUTTON) ||
(lBtnStyle & BS_DEFPUSHBUTTON) )
aCtrlClass = PUSHBUTTON;
}
else if ( 0 == _stricmp( aClassName, "listbox" ) ||
0 == _stricmp( aClassName, "combobox" ) )
aCtrlClass = LISTBOX;
}
return aCtrlClass;
}
//------------------------------------------------------------
//
//------------------------------------------------------------
int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId )
{
if ( aControlId < 0 || aControlId > SIZE_WINDOWS_FILEOPEN_CTRL_IDS )
return aControlId;
return WindowsFileOpenCtrlIds[aControlId];
}
/*************************************************************************
*
* $RCSfile: controlaccess.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
*
* 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 _CONTROLACCESS_HXX_
#define _CONTROLACCESS_HXX_
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _RTL_USTRING_HXX_
#include <rtl/ustring>
#endif
#include <windows.h>
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
#include <com/sun/star/uno/Any.hxx>
#endif
//------------------------------------------------------------------------
// deklarations
//------------------------------------------------------------------------
typedef void ( SAL_CALL *CTRL_SETVALUE_FUNCTION_T)( HWND, const ::com::sun::star::uno::Any&, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&, sal_Int16 );
typedef ::com::sun::star::uno::Any ( SAL_CALL *CTRL_GETVALUE_FUNCTION_T )( HWND );
// the currently supported control classes
enum CTRL_CLASS
{
UNKNOWN = 0,
CHECKBOX,
LISTBOX,
PUSHBUTTON
};
// returns the class of a control
CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl );
// returns a pointer to a setValue function based on the control class
// and the control action, if no function was found NULL will be returned
CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction );
// returns a pointer to a getValue function based on the control class
// and the control action, if no function was found NULL will be returned
CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction );
// translates a CommonFilePickerElementId as defined in CommonFilePickerElementIds.idl
// to a control id that is valid for the FileOpen dialog under windows as defined
// in dlgs.h in the Windows Platform SDK
int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId );
#endif
This diff is collapsed.
/*************************************************************************
*
* $RCSfile: dibpreview.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
*
* 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 _DIBPREVIEW_HXX_
#define _DIBPREVIEW_HXX_
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX
#include <com/sun/star/uno/Sequence.hxx>
#endif
#include <windows.h>
//---------------------------------------------
// A very simple wrapper for a window that does
// display DIBs.
// Maybe it would be better and more extensible
// to create another class that is responsible
// for rendering a specific image format into
// the area of the window, but for our purpose
// it's enough to go the simple way - KISS.
//---------------------------------------------
class CDIBPreview
{
public:
// clients can create instances only
// through the static create method
CDIBPreview(
sal_Int32 x,
sal_Int32 y,
sal_Int32 cx,
sal_Int32 cy,
HWND aParent,
HINSTANCE hInstance,
sal_Bool bShow = sal_True );
// dtor
~CDIBPreview( );
// window size information
void SAL_CALL setWidth( sal_Int32 cx_new );
sal_Int32 SAL_CALL getWidth( ) const;
void SAL_CALL setHeight( sal_Int32 cy_new );
sal_Int32 SAL_CALL getHeight( ) const;
// shows the preview window
// possible values see SHOW_STATE
sal_Bool SAL_CALL show( sal_Bool bShow );
// returns true when the preview window is
// visible and
// false if not
sal_Bool SAL_CALL isVisible( ) const;
// returns the currently supported color
// resolution of the preview window
int SAL_CALL getColorDepth( );
void SAL_CALL setImage( const ::com::sun::star::uno::Sequence< sal_Int8 >& pImageData );
private:
virtual void SAL_CALL onPaint( HWND hWnd, HDC hDC );
static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
private:
HWND m_hwnd;
ATOM m_ClassAtom;
HINSTANCE m_hInstance;
::com::sun::star::uno::Sequence< sal_Int8 > m_ImageData;
sal_Int32 m_cx;
sal_Int32 m_cy;
static CDIBPreview* s_DIBPreviewInst;
// prevent copy and assignment
private:
CDIBPreview( const CDIBPreview& );
CDIBPreview& operator=( const CDIBPreview& );
};
#endif
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
<module-name>fps</module-name>
<component-description>
<author> Tino Rachui </author>
<name> com.sun.star.comp.ui.dialogs.FilePicker </name>
<description>
The win32 implementation of the FilePicker service.
</description>
<loader-name>com.sun.star.loader.SharedLibrary</loader-name>
<language> c++ </language>
<status value="beta"/>
<supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service>
<service-dependency>...</service-dependency>
<type> com.sun.star.ui.dialogs.XExecutableDialog </type>
<type> com.sun.star.ui.dialogs.XFilePicker </type>
<type> com.sun.star.ui.dialogs.XFilterManager </type>
<type> com.sun.star.ui.dialogs.XFilePickerListener </type>
<type> com.sun.star.ui.dialogs.ExecutableDialogException </type>
<type> com.sun.star.ui.dialogs.XFilePickerNotifier </type>
<type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type>
<type> com.sun.star.ui.dialogs.XFilePreview </type>
<type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
<type> com.sun.star.ui.dialogs.ExecutableDialogResults </type>
<type> com.sun.star.ui.dialogs.FilePickerEvent </type>
<type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type>
<type> com.sun.star.ui.dialogs.ListboxControlActions </type>
<type> com.sun.star.ui.dialogs.TemplateDescription </type>
<type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type>
<type> com.sun.star.lang.XComponent </type>
<type> com.sun.star.lang.XMultiServiceFactory </type>
<type> com.sun.star.lang.XSingleServiceFactory </type>
<type> com.sun.star.lang.XServiceInfo </type>
<type> com.sun.star.lang.XTypeProvider </type>
<type> com.sun.star.lang.IllegalArgumentException </type>
<type> com.sun.star.uno.TypeClass </type>
<type> com.sun.star.uno.XWeak </type>
<type> com.sun.star.uno.XAggregation </type>
<type> com.sun.star.registry.XRegistryKey </type>
<type> com.sun.star.container.XSet </type>
</component-description>
<project-build-dependency> cppuhelper </project-build-dependency>
<project-build-dependency> cppu </project-build-dependency>
<project-build-dependency> sal </project-build-dependency>
<runtime-module-dependency> cppuhelper </runtime-module-dependency>
<runtime-module-dependency> cppu2 </runtime-module-dependency>
<runtime-module-dependency> sal2 </runtime-module-dependency>
</module-description>
This diff is collapsed.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Fps.rc
//
#define IDD_DIALOG1 101
#define IDB_BITMAP1 117
#define IDB_BITMAP2 118
#define IDC_BUTTON1 1008
#define stc32 -1
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 119
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1014
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
component_getImplementationEnvironment
component_writeInfo
component_getFactory
This diff is collapsed.
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