Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2188)

Unified Diff: base/win/enum_variant.h

Issue 8588036: Improve support for multiselect list box accessibility on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gypi ('k') | base/win/enum_variant.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/enum_variant.h
===================================================================
--- base/win/enum_variant.h (revision 0)
+++ base/win/enum_variant.h (revision 0)
@@ -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_
« no previous file with comments | « base/base.gypi ('k') | base/win/enum_variant.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698