1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsComposeTxtSrvFilter_h__
7 #define nsComposeTxtSrvFilter_h__
9 #include "mozilla/UniquePtr.h"
14 * This class enables those using it to skip over certain nodes when
17 * This filter is used to skip over various form control nodes and
20 class nsComposeTxtSrvFilter final
{
22 static mozilla::UniquePtr
<nsComposeTxtSrvFilter
> CreateNormalFilter() {
23 return CreateHelper(false);
25 static mozilla::UniquePtr
<nsComposeTxtSrvFilter
> CreateMailFilter() {
26 return CreateHelper(true);
30 * Indicates whether the content node should be skipped by the iterator
31 * @param aNode - node to skip
33 bool Skip(nsINode
* aNode
) const;
36 // Helper - Intializer
37 void Init(bool aIsForMail
) { mIsForMail
= aIsForMail
; }
39 static mozilla::UniquePtr
<nsComposeTxtSrvFilter
> CreateHelper(
42 bool mIsForMail
= false;