2009-12-03 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / tabnavigationwalker.h
blobb616ae69d99df7cd9300995aa06db5679636694c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * Contact:
4 * Moonlight List (moonlight-list@lists.ximian.com)
6 * Copyright 2009 Novell, Inc. (http://www.novell.com)
8 * See the LICENSE file included with the distribution for details.
9 */
11 #ifndef __MOON_TABNAVIGATIONWALKER_H__
12 #define __MOON_TABNAVIGATIONWALKER_H__
14 #include "dependencyobject.h"
15 #include "control.h"
17 /* @Namespace=None */
18 class TabNavigationWalker {
19 public:
20 /* @GenerateCBinding,GeneratePInvoke */
21 static bool Focus (UIElement *element, bool forwards);
23 private:
24 TabNavigationWalker (UIElement *root, UIElement *current, bool forwards, Types *types);
25 ~TabNavigationWalker ();
27 bool forwards;
28 UIElement *current;
29 UIElement *root;
30 GPtrArray *tab_sorted;
31 Types *types;
33 bool FocusChild ();
34 bool ForwardTab () { return forwards; }
35 bool ReverseTab () { return !forwards; }
36 bool TabTo (Control *control);
37 bool WalkChildren (UIElement *root, UIElement *current = NULL);
39 static KeyboardNavigationMode GetActiveNavigationMode (UIElement *element, Types *types);
40 static void Sort (GPtrArray *array, Types *types);
41 static int TabCompare (Control *left, Control *right);
42 static bool WalkChildren (UIElement *root, UIElement *current, bool forwards, Types *types);
45 #endif /* __MOON_TABNAVIGATIONWALKER_H__ */