1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_NAMESCOPE_H__
12 #define __MOON_NAMESCOPE_H__
15 #include "dependencyobject.h"
20 /* @ManagedDependencyProperties=None */
21 /* @ManagedEvents=None */
22 class NameScope
: public DependencyObject
{
27 static void ObjectDestroyedEvent (EventObject
*sender
, EventArgs
*args
, gpointer closure
);
28 static gboolean
remove_handler (gpointer key
, gpointer value
, gpointer data
);
29 static void merge_name (gpointer key
, gpointer value
, gpointer user_data
);
32 virtual ~NameScope ();
34 virtual void CloneCore (Types
*types
, DependencyObject
*fromObj
);
37 /* @PropertyType=NameScope,Attached,GenerateAccessors */
38 const static int NameScopeProperty
;
40 /* @GenerateCBinding*/
43 virtual void Dispose ();
45 void RegisterName (const char *name
, DependencyObject
*object
);
46 void UnregisterName (const char *name
);
48 DependencyObject
*FindName (const char *name
);
50 bool GetIsLocked () { return is_locked
; }
51 void Lock () { is_locked
= true; }
53 void SetTemporary (bool flag
) { temporary
= flag
; }
54 bool GetTemporary () { return temporary
; }
56 void MergeTemporaryScope (NameScope
*scope
, MoonError
*error
);
58 static NameScope
*GetNameScope (DependencyObject
*obj
);
59 static void SetNameScope (DependencyObject
*obj
, NameScope
*scope
);
63 GHashTable
*GetNames () { return names
; }
66 #endif /* __MOON_NAMESCOPE_H__ */