dom/fmradio/FMRadioCommon.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/fmradio/FMRadioCommon.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef FMRADIOCOMMON_H_
    1.11 +#define FMRADIOCOMMON_H_
    1.12 +
    1.13 +#include "mozilla/Observer.h"
    1.14 +
    1.15 +#undef FM_LOG
    1.16 +#if defined(ANDROID)
    1.17 +#include <android/log.h>
    1.18 +#define FM_LOG(FMRADIO_LOG_INFO, args...) \
    1.19 +  __android_log_print(ANDROID_LOG_INFO, \
    1.20 +                      FMRADIO_LOG_INFO, \
    1.21 +                      ## args)
    1.22 +#else
    1.23 +#define FM_LOG(args...)
    1.24 +#endif
    1.25 +
    1.26 +#define BEGIN_FMRADIO_NAMESPACE \
    1.27 +  namespace mozilla { namespace dom {
    1.28 +#define END_FMRADIO_NAMESPACE \
    1.29 +  } /* namespace dom */ } /* namespace mozilla */
    1.30 +
    1.31 +BEGIN_FMRADIO_NAMESPACE
    1.32 +
    1.33 +enum FMRadioEventType
    1.34 +{
    1.35 +  FrequencyChanged,
    1.36 +  EnabledChanged
    1.37 +};
    1.38 +
    1.39 +typedef mozilla::Observer<FMRadioEventType>     FMRadioEventObserver;
    1.40 +typedef mozilla::ObserverList<FMRadioEventType> FMRadioEventObserverList;
    1.41 +
    1.42 +END_FMRADIO_NAMESPACE
    1.43 +
    1.44 +#endif /* FMRADIOCOMMON_H_ */
    1.45 +

mercurial