gecko-dev/gfx/2d/Preferences.h
Bob Owen b24d50e720 Bug 1156742 Part 20: Move Moz2D PreferenceAccess into its own header. r=bas
This is so we can add a new preference in Part 21, which has nothing to do with logging.
2016-01-05 10:08:58 +00:00

35 lines
1.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_gfx_Preferences_h
#define mozilla_gfx_Preferences_h
namespace mozilla {
namespace gfx {
class PreferenceAccess
{
public:
virtual ~PreferenceAccess() {};
// This will be called with the derived class, so we will can register the
// callbacks with it.
static void SetAccess(PreferenceAccess* aAccess);
static int32_t RegisterLivePref(const char* aName, int32_t* aVar,
int32_t aDefault);
protected:
// This should connect the variable aVar to be updated whenever a preference
// aName is modified. aDefault would be used if the preference is undefined,
// so that we always get the valid value for aVar.
virtual void LivePref(const char* aName, int32_t* aVar, int32_t aDefault) = 0;
};
} // namespace gfx
} // namespace mozilla
#endif // mozilla_gfx_Preferences_h