зеркало из https://github.com/mozilla/pjs.git
rename Profile->Virtual and change API slightly to be more COM like
This commit is contained in:
Родитель
7793e603f7
Коммит
c4b2cb9a07
|
@ -36,7 +36,7 @@ extern "C" {
|
|||
const PRUint32 F_ISGROUP = 0x00000001;
|
||||
const PRUint32 F_EXPANDED = 0x00000002;
|
||||
const PRUint32 F_CATCONT = 0x00000004;
|
||||
const PRUint32 F_PROFILE = 0x00000008;
|
||||
const PRUint32 F_VIRTUAL = 0x00000008;
|
||||
const PRUint32 F_DIRTY = 0x00000010;
|
||||
const PRUint32 F_DESCENDENTSLOADED = 0x00000020;
|
||||
const PRUint32 F_HTMLOKGROUP = 0x00000040;
|
||||
|
@ -321,16 +321,18 @@ nsMsgGroupRecord::GetCategoryContainer()
|
|||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsMsgGroupRecord::IsProfile()
|
||||
nsresult
|
||||
nsMsgGroupRecord::IsVirtual(PRBool *retval)
|
||||
{
|
||||
return (m_flags & F_PROFILE) != 0;
|
||||
*retval =( (m_flags & F_VIRTUAL) != 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsMsgGroupRecord::SetIsProfile(PRBool value)
|
||||
nsresult
|
||||
nsMsgGroupRecord::SetIsVirtual(PRBool value)
|
||||
{
|
||||
return TweakFlag(F_PROFILE, value);
|
||||
TweakFlag(F_VIRTUAL, value);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,158 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// This class should only be used by the subscribe UI and by newshost.cpp.
|
||||
// And, well, a bit by the category code. Everyone else should use the stuff
|
||||
// in newshost.h.
|
||||
|
||||
#ifndef _nsMsgGroupRecord_h_
|
||||
#define _nsMsgGroupRecord_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
class nsIMAPGroupRecord;
|
||||
|
||||
class nsMsgGroupRecord {
|
||||
public:
|
||||
static nsMsgGroupRecord* Create(nsMsgGroupRecord* parent,
|
||||
const char* partname,
|
||||
PRInt64 m_addtime,
|
||||
PRInt32 uniqueid,
|
||||
PRInt32 fileoffset);
|
||||
static nsMsgGroupRecord* Create(nsMsgGroupRecord* parent,
|
||||
const char* saveline,
|
||||
PRInt32 savelinelength,
|
||||
PRInt32 fileoffset);
|
||||
|
||||
|
||||
virtual void InitializeSibling();
|
||||
virtual PRBool IsIMAPGroupRecord() { return PR_FALSE; }
|
||||
virtual nsIMAPGroupRecord *GetIMAPGroupRecord() { return 0; }
|
||||
|
||||
// This is just like PL_strcmp(), except it works on news group names.
|
||||
// A container groupname is always less than any contained groups.
|
||||
// So, "netscape.devs-client-technical" > "netscape.devs.directory", even
|
||||
// though PL_strcmp says otherwise. (YICK!)
|
||||
static int GroupNameCompare(const char* name1,
|
||||
const char* name2,
|
||||
char delimiter = '.',
|
||||
PRBool caseInsensitive = PR_FALSE);
|
||||
|
||||
|
||||
virtual ~nsMsgGroupRecord();
|
||||
|
||||
nsMsgGroupRecord* FindDescendant(const char* name);
|
||||
|
||||
nsMsgGroupRecord* GetParent() {return m_parent;}
|
||||
nsMsgGroupRecord* GetChildren() {return m_children;}
|
||||
nsMsgGroupRecord* GetSibling() {return m_sibling;}
|
||||
nsMsgGroupRecord* GetSiblingOrAncestorSibling();
|
||||
nsMsgGroupRecord* GetNextAlphabetic();
|
||||
|
||||
nsMsgGroupRecord* GetNextAlphabeticNoCategories();
|
||||
|
||||
const char* GetPartName() {return m_partname;}
|
||||
|
||||
// The resulting string must be free'd using delete[].
|
||||
char* GetFullName();
|
||||
|
||||
const char* GetPrettyName() {return m_prettyname;}
|
||||
int SetPrettyName(const char* prettyname);
|
||||
|
||||
PRInt64 GetAddTime() {return m_addtime;}
|
||||
|
||||
virtual PRBool IsCategory();
|
||||
virtual PRBool IsCategoryContainer();
|
||||
virtual int SetIsCategoryContainer(PRBool value);
|
||||
|
||||
nsMsgGroupRecord* GetCategoryContainer();
|
||||
|
||||
// Get/Set whether this is a virtual newsgroup.
|
||||
PRBool IsProfile();
|
||||
int SetIsProfile(PRBool value);
|
||||
|
||||
// Get/Set whether this is really a newsgroup (and not just a container
|
||||
// for newsgroups).
|
||||
virtual PRBool IsGroup();
|
||||
int SetIsGroup(PRBool value);
|
||||
|
||||
PRBool IsDescendentsLoaded();
|
||||
int SetIsDescendentsLoaded(PRBool value);
|
||||
|
||||
PRBool IsExpanded();
|
||||
int SetIsExpanded(PRBool value);
|
||||
|
||||
PRBool IsHTMLOKGroup();
|
||||
int SetIsHTMLOKGroup(PRBool value);
|
||||
|
||||
PRBool IsHTMLOKTree();
|
||||
int SetIsHTMLOKTree(PRBool value);
|
||||
|
||||
PRBool NeedsExtraInfo();
|
||||
int SetNeedsExtraInfo(PRBool value);
|
||||
|
||||
PRBool DoesNotExistOnServer();
|
||||
int SetDoesNotExistOnServer(PRBool value);
|
||||
|
||||
PRInt32 GetUniqueID() {return m_uniqueId;}
|
||||
|
||||
PRInt32 GetFileOffset() {return m_fileoffset;}
|
||||
int SetFileOffset(PRInt32 value) {m_fileoffset = value; return 0;}
|
||||
|
||||
// Get the number of descendents (not including ourself) that are
|
||||
// really newsgroups.
|
||||
PRInt32 GetNumKids();
|
||||
|
||||
// Gets the string that represents this group in the save file. The
|
||||
// resulting string must be free'd with PR_Free().
|
||||
char* GetSaveString();
|
||||
|
||||
PRBool IsDirty(); // Whether this record has had changes made
|
||||
// to it. Cleared by calls to GetSaveString().
|
||||
|
||||
PRInt32 GetDepth(); // Returns how deep in the heirarchy we are.
|
||||
// Basically, the number of dots in the full
|
||||
// newsgroup name, plus 1.
|
||||
virtual char GetHierarchySeparator() { return '.'; }
|
||||
|
||||
protected:
|
||||
nsMsgGroupRecord(nsMsgGroupRecord* parent,
|
||||
const char* partname,
|
||||
PRInt64 m_addtime,
|
||||
PRInt32 uniqueid,
|
||||
PRInt32 fileoffset,
|
||||
char delimiter = '.');
|
||||
int TweakFlag(PRUint32 flagbit, PRBool value);
|
||||
char* SuckInName(char* ptr);
|
||||
|
||||
char* m_partname;
|
||||
char* m_prettyname;
|
||||
nsMsgGroupRecord* m_parent;
|
||||
nsMsgGroupRecord* m_children;
|
||||
nsMsgGroupRecord* m_sibling;
|
||||
PRUint32 m_flags;
|
||||
PRInt64 m_addtime;
|
||||
PRInt32 m_uniqueId;
|
||||
PRInt32 m_fileoffset;
|
||||
char m_delimiter;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _grec_h_ */
|
Загрузка…
Ссылка в новой задаче