LibreOffice Module cli_ure (master) 1
cli_environment.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_CLI_URE_SOURCE_UNO_BRIDGE_CLI_ENVIRONMENT_H
21#define INCLUDED_CLI_URE_SOURCE_UNO_BRIDGE_CLI_ENVIRONMENT_H
22
23#include "cli_base.h"
24
25using namespace System;
26using namespace System::Collections;
27using namespace System::Runtime::Serialization;
28
29namespace cli_uno
30{
31public
33{
34 static System::String ^ sOidPart;
36 static System::Runtime::Serialization::ObjectIDGenerator ^ m_IDGen;
37 inline static System::String ^ createKey(System::String ^ oid, System::Type ^ t);
38
39#if OSL_DEBUG_LEVEL >= 1
41#endif
42
44 {
45 m_objects = Hashtable::Synchronized(gcnew Hashtable());
46 m_IDGen = gcnew System::Runtime::Serialization::ObjectIDGenerator();
47 System::Text::StringBuilder ^ buffer = gcnew System::Text::StringBuilder(256);
48 Guid gd = Guid::NewGuid();
49 buffer->Append(";cli[0];");
50 buffer->Append(gd.ToString());
51 sOidPart = buffer->ToString();
52 }
53
54public:
56
59
65 Object ^ registerInterface(Object ^ obj, System::String ^ oid);
70 Object ^ registerInterface(Object ^ obj, System::String ^ oid, System::Type ^ type);
71
77 inline void revokeInterface(System::String ^ oid);
78
79 void revokeInterface(System::String ^ oid, System::Type ^ type);
88 Object ^ getRegisteredInterface(System::String ^ oid, System::Type ^ type);
89
98 static System::String ^ getObjectIdentifier(Object ^ obj);
99};
100
101} //namespace cli_uno
102
103#endif
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unordered_map< std::string, LinkedList > Hashtable
static Hashtable m_objects
static System::String createKey(System::String ^ oid, System::Type ^ t)
Object registerInterface(Object ^ obj, System::String ^ oid)
Registers a UNO object as being mapped by this bridge.
Object registerInterface(Object ^ obj, System::String ^ oid, System::Type ^ type)
Registers a CLI object as being mapped by this bridge.
void revokeInterface(System::String ^ oid, System::Type ^ type)
void revokeInterface(System::String ^ oid)
By revoking an interface it is declared that the respective interface has not been mapped.
static System::Runtime::Serialization::ObjectIDGenerator m_IDGen
Object getRegisteredInterface(System::String ^ oid, System::Type ^ type)
Retrieves an interface identified by its object id and type from this environment.
static System::String getObjectIdentifier(Object ^ obj)
Generates a worldwide unique object identifier (oid) for the given object.
static System::String sOidPart