bump product version to 4.2.0.1
[LibreOffice.git] / svl / source / svdde / ddeimp.hxx
blobbf31a1ed94c7e4f30dc13ab6a252e8cefc486fa5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVL_SOURCE_SVDDE_DDEIMP_HXX
21 #define INCLUDED_SVL_SOURCE_SVDDE_DDEIMP_HXX
23 #include <windows.h>
24 #include <ddeml.h>
26 #include <boost/noncopyable.hpp>
27 #include <rtl/ustring.hxx>
28 #include <svl/svdde.hxx>
29 #include <tools/shl.hxx>
30 #include <vector>
32 // ----------------
33 // - Conversation -
34 // ----------------
36 struct Conversation
38 HCONV hConv;
39 DdeTopic* pTopic;
42 typedef ::std::vector< Conversation* > ConvList;
44 // ---------------
45 // - DdeInternal -
46 // ---------------
48 class DdeInternal
50 public:
51 static HDDEDATA CALLBACK CliCallback
52 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
53 static HDDEDATA CALLBACK SvrCallback
54 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
55 static HDDEDATA CALLBACK InfCallback
56 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
57 static DdeService* FindService( HSZ );
58 static DdeTopic* FindTopic( DdeService&, HSZ );
59 static DdeItem* FindItem( DdeTopic&, HSZ );
62 // -------------
63 // - DdeString -
64 // -------------
66 class DdeString
68 private:
69 OUString m_aString;
70 protected:
71 HSZ hString;
72 DWORD hInst;
74 public:
75 DdeString( DWORD, const sal_Unicode* );
76 DdeString( DWORD, const OUString& );
77 ~DdeString();
79 int operator==( HSZ );
80 operator HSZ();
81 OUString toOUString() const { return m_aString; }
84 // --------------
85 // - DdeDataImp -
86 // --------------
88 struct DdeDataImp
90 HDDEDATA hData;
91 LPBYTE pData;
92 long nData;
93 sal_uLong nFmt;
96 class DdeConnection;
98 class DdeInstData : private boost::noncopyable
100 public:
101 sal_uInt16 nRefCount;
102 std::vector<DdeConnection*> aConnections;
103 // Server
104 sal_IntPtr hCurConvSvr;
105 DWORD hDdeInstSvr;
106 short nInstanceSvr;
107 DdeServices* pServicesSvr;
108 // Client
109 DWORD hDdeInstCli;
110 short nInstanceCli;
112 DdeInstData()
113 : nRefCount(0)
114 , hCurConvSvr(0)
115 , hDdeInstSvr(0)
116 , nInstanceSvr(0)
117 , pServicesSvr(NULL)
118 , hDdeInstCli(0)
119 , nInstanceCli(0)
124 #ifndef SHL_SVDDE
125 #define SHL_SVDDE SHL_SHL2
126 #endif
128 inline DdeInstData* ImpGetInstData()
130 return (DdeInstData*)(*GetAppData( SHL_SVDDE ));
132 DdeInstData* ImpInitInstData();
133 void ImpDeinitInstData();
135 #endif // INCLUDED_SVL_SOURCE_SVDDE_DDEIMP_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */