1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * resources.h: Resource dictionaries.
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_RESOURCES_H__
12 #define __MOON_RESOURCES_H__
16 #include "collection.h"
19 /* @Namespace=System.Windows */
20 class ResourceDictionary
: public Collection
{
22 /* @PropertyType=ResourceDictionaryCollection,AutoCreateValue,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
23 const static int MergedDictionariesProperty
;
25 /* @GenerateCBinding,GeneratePInvoke */
26 ResourceDictionary ();
28 /* just to provide an implementation. our CanAdd always returns true. */
29 virtual Type::Kind
GetElementType () { return Type::INVALID
;}
31 bool Add (const char* key
, Value
*value
);
33 /* @GenerateCBinding,GeneratePInvoke */
34 bool AddWithError (const char* key
, Value
*value
, MoonError
*error
);
36 /* @GenerateCBinding,GeneratePInvoke */
39 /* @GenerateCBinding,GeneratePInvoke */
40 bool ContainsKey (const char *key
);
42 /* @GenerateCBinding,GeneratePInvoke */
43 bool Remove (const char *key
);
45 /* @GenerateCBinding,GeneratePInvoke */
46 bool Set (const char *key
, Value
*value
);
48 /* @GenerateCBinding,GeneratePInvoke */
49 Value
* Get (const char *key
, bool *exists
);
50 Value
* GetFromMergedDictionaries (const char *key
, bool *exists
);
52 ResourceDictionaryCollection
*GetMergedDictionaries ();
53 void SetMergedDictionaries (ResourceDictionaryCollection
* value
);
55 virtual void SetSurface (Surface
*surface
);
56 virtual void UnregisterAllNamesRootedAt (NameScope
*from_ns
);
57 virtual void RegisterAllNamesRootedAt (NameScope
*to_ns
, MoonError
*error
);
60 virtual ~ResourceDictionary ();
62 virtual bool CanAdd (Value
*value
);
64 virtual bool AddedToCollection (Value
*value
, MoonError
*error
);
65 virtual void RemovedFromCollection (Value
*value
);
69 bool from_resource_dictionary_api
;
72 #endif /* __MOON_RESOURCES_H__ */