update dev300-m58
[ooovba.git] / dtrans / test / win32 / dnd / transferable.hxx
blobbf44dac90fd8c07a67aaa9b884e9be38f7d3c4b4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transferable.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _TRANSFERABLE_HXX_
31 #define _TRANSFERABLE_HXX_
33 //_________________________________________________________________________________________________________________________
34 // interface includes
35 //_________________________________________________________________________________________________________________________
38 //#include "..\ImplHelper.hxx"
40 //_________________________________________________________________________________________________________________________
41 // other includes
42 //_________________________________________________________________________________________________________________________
44 #include <cppuhelper/servicefactory.hxx>
45 #include <com/sun/star/datatransfer/XTransferable.hpp>
46 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
47 #include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
48 #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
49 #include <com/sun/star/lang/XComponent.hpp>
50 #include <cppuhelper/implbase2.hxx>
51 #include <rtl/ustring.hxx>
52 #include <sal/types.h>
53 #include <osl/diagnose.h>
55 #include <stdio.h>
56 #if defined _MSC_VER
57 #pragma warning(push,1)
58 #endif
59 #include <windows.h>
60 #include <objbase.h>
61 #if defined _MSC_VER
62 #pragma warning(pop)
63 #endif
65 #include <memory>
67 #include <process.h>
69 #include "..\..\source\win32\ImplHelper.hxx"
72 //-------------------------------------------------------------
73 // my defines
74 //-------------------------------------------------------------
76 #define TEST_CLIPBOARD
77 #define RDB_SYSPATH "d:\\projects\\src616\\dtrans\\wntmsci7\\bin\\applicat.rdb"
78 #define WINCLIPBOARD_SERVICE_NAME L"com.sun.star.datatransfer.clipboard.SystemClipboard"
79 #define WRITE_CB
80 #define EVT_MANUAL_RESET TRUE
81 #define EVT_INIT_NONSIGNALED FALSE
82 #define EVT_NONAME ""
84 //------------------------------------------------------------
85 // namesapces
86 //------------------------------------------------------------
88 using namespace ::rtl;
89 using namespace ::std;
90 using namespace ::cppu;
91 using namespace ::com::sun::star::datatransfer;
92 using namespace ::com::sun::star::datatransfer::clipboard;
93 using namespace ::com::sun::star::uno;
94 using namespace ::com::sun::star::io;
95 using namespace ::com::sun::star::lang;
97 //------------------------------------------------------------
98 //
99 //------------------------------------------------------------
101 class CTransferable : public WeakImplHelper2< XClipboardOwner, XTransferable >
103 public:
104 CTransferable( ){};
105 CTransferable( wchar_t* dataString);
107 //-------------------------------------------------
108 // XTransferable
109 //-------------------------------------------------
111 virtual Any SAL_CALL getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException);
112 virtual Sequence< DataFlavor > SAL_CALL getTransferDataFlavors( ) throw(RuntimeException);
113 virtual sal_Bool SAL_CALL isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException);
115 //-------------------------------------------------
116 // XClipboardOwner
117 //-------------------------------------------------
119 virtual void SAL_CALL lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans ) throw(RuntimeException);
121 private:
122 Sequence< DataFlavor > m_seqDFlv;
123 OUString m_Data;
127 #endif