Bug 1265818 - Part 1 - Convert nsILayoutHistoryState header to IDL. r=jst

Preparatory step to make nsILayoutHistoryState scriptable.

MozReview-Commit-ID: DWgXr0imRVb

--HG--
rename : layout/base/nsILayoutHistoryState.h => layout/base/nsILayoutHistoryState.idl
extra : rebase_source : c64ef4108df187c750852d5a364a5cb15d4e9d0d
This commit is contained in:
Jan Henning 2017-03-04 14:06:11 +01:00
Родитель a1f02152df
Коммит 3d605b1465
3 изменённых файлов: 25 добавлений и 38 удалений

Просмотреть файл

@ -20,6 +20,7 @@ with Files('AccessibleCaret*'):
BUG_COMPONENT = ('Core', 'Selection')
XPIDL_SOURCES += [
'nsILayoutHistoryState.idl',
'nsIPreloadedStyleSheet.idl',
'nsIStyleSheetService.idl',
]
@ -47,7 +48,6 @@ EXPORTS += [
'nsFrameTraversal.h',
'nsIFrameTraversal.h',
'nsILayoutDebugger.h',
'nsILayoutHistoryState.h',
'nsIPercentBSizeObserver.h',
'nsIPresShell.h',
'nsIPresShellInlines.h',

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
@ -8,22 +8,24 @@
* the document is not
*/
#ifndef _nsILayoutHistoryState_h
#define _nsILayoutHistoryState_h
#include "nsISupports.idl"
#include "nsISupports.h"
interface nsPresState;
[ptr] native nsPresStatePtr(nsPresState);
[ref] native nsCString(const nsCString);
native constBool(const bool);
%{C++
#include "nsStringFwd.h"
class nsPresState;
template<typename> struct already_AddRefed;
%}
#define NS_ILAYOUTHISTORYSTATE_IID \
{ 0xaef27cb3, 0x4df9, 0x4eeb, \
{ 0xb0, 0xb0, 0xac, 0x56, 0xcf, 0x86, 0x1d, 0x04 } }
class nsILayoutHistoryState : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUTHISTORYSTATE_IID)
[uuid(aef27cb3-4df9-4eeb-b0b0-ac56cf861d04)]
interface nsILayoutHistoryState : nsISupports
{
// Native only interface, converted from the original nsILayoutHistoryState.h
/**
* Set |aState| as the state object for |aKey|.
@ -31,40 +33,38 @@ class nsILayoutHistoryState : public nsISupports {
* It will be freed when RemoveState() is called or when the
* LayoutHistoryState is destroyed.
*/
virtual void AddState(const nsCString& aKey, nsPresState* aState) = 0;
[noscript, notxpcom, nostdcall] void AddState(in nsCString aKey, in nsPresStatePtr aState);
/**
* Look up the state object for |aKey|.
*/
virtual nsPresState* GetState(const nsCString& aKey) = 0;
[noscript, notxpcom, nostdcall] nsPresStatePtr GetState(in nsCString aKey);
/**
* Remove the state object for |aKey|.
*/
virtual void RemoveState(const nsCString& aKey) = 0;
[noscript, notxpcom, nostdcall] void RemoveState(in nsCString aKey);
/**
* Check whether this history has any states in it
*/
virtual bool HasStates() const = 0;
[noscript, notxpcom, nostdcall] boolean HasStates();
/**
* Sets whether this history can contain only scroll position history
* or all possible history
*/
virtual void SetScrollPositionOnly(const bool aFlag) = 0;
[noscript, notxpcom, nostdcall] void SetScrollPositionOnly(in constBool aFlag);
/**
* Resets nsPresState::GetScrollState of all nsPresState objects to 0,0.
*/
virtual void ResetScrollState() = 0;
[noscript, notxpcom, nostdcall] void ResetScrollState();
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutHistoryState,
NS_ILAYOUTHISTORYSTATE_IID)
%{C++
already_AddRefed<nsILayoutHistoryState>
NS_NewLayoutHistoryState();
%}
#endif /* _nsILayoutHistoryState_h */

Просмотреть файл

@ -24,20 +24,7 @@ public:
}
NS_DECL_ISUPPORTS
// nsILayoutHistoryState
virtual void
AddState(const nsCString& aKey, nsPresState* aState) override;
virtual nsPresState*
GetState(const nsCString& aKey) override;
virtual void
RemoveState(const nsCString& aKey) override;
virtual bool
HasStates() const override;
virtual void
SetScrollPositionOnly(const bool aFlag) override;
virtual void
ResetScrollState() override;
NS_DECL_NSILAYOUTHISTORYSTATE
private:
~nsLayoutHistoryState() {}
@ -85,7 +72,7 @@ nsLayoutHistoryState::RemoveState(const nsCString& aKey)
}
bool
nsLayoutHistoryState::HasStates() const
nsLayoutHistoryState::HasStates()
{
return mStates.Count() != 0;
}