summaryrefslogtreecommitdiffstats
path: root/base/win/enum_variant.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 04:31:13 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 04:31:13 +0000
commitc43b0dcbeb14720b12eb019db586b07c01f6ede4 (patch)
tree40d9314acfb361d9c75ec2d8eef9000ffc6a0562 /base/win/enum_variant.h
parentc80b8ee2e4a157c905c4ac19b97ac78eb4253b6c (diff)
downloadchromium_src-c43b0dcbeb14720b12eb019db586b07c01f6ede4.zip
chromium_src-c43b0dcbeb14720b12eb019db586b07c01f6ede4.tar.gz
chromium_src-c43b0dcbeb14720b12eb019db586b07c01f6ede4.tar.bz2
Improve support for multiselect list box accessibility on Windows.
Exposes several new states and attributes and fires new notifications when the selection changes. Adds general-purpose implementations of IUnknown and IEnumVARIANT to base/win/, which will be used in the future as we remote ATL from accessibility code. BUG=5027,98984 TEST=manual testing with JAWS and NVDA Review URL: http://codereview.chromium.org/8588036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win/enum_variant.h')
-rw-r--r--base/win/enum_variant.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/base/win/enum_variant.h b/base/win/enum_variant.h
new file mode 100644
index 0000000..84c8a99
--- /dev/null
+++ b/base/win/enum_variant.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_WIN_ENUM_VARIANT_H_
+#define BASE_WIN_ENUM_VARIANT_H_
+#pragma once
+
+#include <unknwn.h>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/win/iunknown_impl.h"
+
+namespace base {
+namespace win {
+
+// A simple implementation of IEnumVARIANT.
+class BASE_EXPORT EnumVariant
+ : public IEnumVARIANT,
+ public IUnknownImpl {
+ public:
+ // The constructor allocates an array of size |count|. Then use
+ // ItemAt to set the value of each item in the array to initialize it.
+ explicit EnumVariant(unsigned long count);
+
+ // Returns a mutable pointer to the item at position |index|.
+ VARIANT* ItemAt(unsigned long index);
+
+ // IUnknown.
+ ULONG STDMETHODCALLTYPE AddRef() OVERRIDE;
+ ULONG STDMETHODCALLTYPE Release() OVERRIDE;
+ STDMETHODIMP QueryInterface(REFIID riid, void** ppv) OVERRIDE;
+
+ // IEnumVARIANT.
+ STDMETHODIMP Next(ULONG requested_count,
+ VARIANT* out_elements,
+ ULONG* out_elements_received);
+ STDMETHODIMP Skip(ULONG skip_count);
+ STDMETHODIMP Reset();
+ STDMETHODIMP Clone(IEnumVARIANT** out_cloned_object);
+
+ private:
+ ~EnumVariant();
+
+ scoped_array<VARIANT> items_;
+ unsigned long count_;
+ unsigned long current_index_;
+};
+
+} // namespace win
+} // namespace base
+
+#endif // BASE_WIN_ENUM_VARIANT_H_