46 Commits

Author SHA1 Message Date
mjudge%netscape.com
77323a8468 66318 r= kin, sr=kin tested by ducarozz ,phil chofmann approved..changing APIS to be idl so we can use in embedding land... lots of string changes too to nsAStrings
git-svn-id: svn://10.0.0.236/trunk@91610 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-07 00:45:26 +00:00
kin%netscape.com
7365b2cbe5 Fixes for bug #66308 ([embed] XPIDL'ize transaction manager)
sr=sfraser@netscape.com,mscott@netscape.com r=jfrancis@netscape.com

* nsITransaction, nsITransactionListenter, nsITransactionManager have
  been XPIDL'ized and moved into mozilla/editor/txmgr/idl. The versions
  of these interfaces in mozilla/editor/txmgr/public are being CVS removed.

* Renamed Do(), Undo(), and Redo() to DoTransaction(), UndoTransaction(),
  and RedoTransaction() to avoid reserved word problems in languages like
  JS. I did a sweep through editor and mailnews to remove these methods.

* PeekUndoStack() and PeekRedoStack() now return an AddRef'd pointer.

* Removed GetUndoString(), GetRedoString() and Write() from the
  nsITransaction interface. Neither editor or mailnews really made
  use of these methods.

* Removed Write() from the nsITransactionManager.cpp interface.

* The Transaction Manager now supports weak references.

* Added support for nsITransactionList to the TransactionManager
  to allow access to all transactions on the Undo and Redo stacks, as
  well as auto-aggregated transactions.

* Removed all references to nsITransactionDescription from txmgr and editor.

* Added nsPIEditorTransaction and made all Editor internal transactions
  inherit from it so we can distinguish between our transactions and
  ones from 3rd parties.

New files checked in:

  editor/txmgr/idl/nsITransaction.idl
  editor/txmgr/idl/nsITransactionList.idl
  editor/txmgr/idl/nsITransactionListener.idl
  editor/txmgr/idl/nsITransactionManager.idl
  editor/txmgr/src/nsITransactionList.cpp
  editor/txmgr/src/nsITransactionList.h
  editor/idl/nsPIEditorTransaction.idl

Files that were CVS removed:

  editor/txmgr/public/nsITransaction.h
  editor/txmgr/public/nsITransactionListener.h
  editor/txmgr/public/nsITransactionManager.h
  editor/txmgr/idl/nsITransactionDescription.h
  editor/base/IMECommitTxn.cpp
  editor/base/IMECommitTxn.h

Files modified:

  editor/Makefile.in
  editor/makefile.win
  editor/base/ChangeAttributeTxn.cpp
  editor/base/ChangeAttributeTxn.h
  editor/base/CreateElementTxn.cpp
  editor/base/CreateElementTxn.h
  editor/base/DeleteElementTxn.cpp
  editor/base/DeleteElementTxn.h
  editor/base/DeleteRangeTxn.cpp
  editor/base/DeleteRangeTxn.h
  editor/base/DeleteTextTxn.cpp
  editor/base/DeleteTextTxn.h
  editor/base/EditAggregateTxn.cpp
  editor/base/EditAggregateTxn.h
  editor/base/EditTxn.cpp
  editor/base/EditTxn.h
  editor/base/IMECommitTxn.cpp
  editor/base/IMECommitTxn.h
  editor/base/IMETextTxn.cpp
  editor/base/IMETextTxn.h
  editor/base/InsertElementTxn.cpp
  editor/base/InsertElementTxn.h
  editor/base/InsertTextTxn.cpp
  editor/base/InsertTextTxn.h
  editor/base/JoinElementTxn.cpp
  editor/base/JoinElementTxn.h
  editor/base/nsEditor.cpp
  editor/base/nsEditorShell.cpp
  editor/base/nsEditorShell.h
  editor/base/nsEditorTxnLog.cpp
  editor/base/nsStyleSheetTxns.cpp
  editor/base/nsStyleSheetTxns.h
  editor/base/PlaceholderTxn.cpp
  editor/base/PlaceholderTxn.h
  editor/base/SetDocTitleTxn.cpp
  editor/base/SetDocTitleTxn.h
  editor/base/SplitElementTxn.cpp
  editor/base/SplitElementTxn.h
  editor/idl/Makefile.in
  editor/idl/makefile.win
  editor/idl/MANIFEST
  editor/idl/nsIEditorShell.idl
  editor/macbuild/editor.mcp
  editor/macbuild/EditorIDL.mcp
  editor/txmgr/idl/Makefile.in
  editor/txmgr/idl/makefile.win
  editor/txmgr/idl/MANIFEST
  editor/txmgr/idl/nsITransactionManager.idl
  editor/txmgr/macbuild/txmgr.mcp
  editor/txmgr/macbuild/txmgrIDL.mcp
  editor/txmgr/public/Makefile.in
  editor/txmgr/public/makefile.win
  editor/txmgr/public/MANIFEST
  editor/txmgr/src/Makefile.in
  editor/txmgr/src/makefile.win
  editor/txmgr/src/nsTransactionItem.cpp
  editor/txmgr/src/nsTransactionItem.h
  editor/txmgr/src/nsTransactionList.cpp
  editor/txmgr/src/nsTransactionList.h
  editor/txmgr/src/nsTransactionManager.cpp
  editor/txmgr/src/nsTransactionManager.h
  editor/txmgr/src/nsTransactionManagerFactory.cpp
  editor/txmgr/src/nsTransactionStack.cpp
  editor/txmgr/src/nsTransactionStack.h
  editor/txmgr/tests/TestTXMgr.cpp
  editor/ui/composer/content/EditorCommandsDebug.js
  editor/ui/composer/content/editorOverlay.xul
  editor/ui/composer/locale/en-US/editorOverlay.dtd
  mailnews/base/src/nsMessenger.cpp
  mailnews/base/util/nsMsgTxn.cpp
  mailnews/base/util/nsMsgTxn.h
  mailnews/imap/src/nsImapMailFolder.cpp
  mailnews/imap/src/nsImapUndoTxn.cpp
  mailnews/imap/src/nsImapUndoTxn.h
  mailnews/local/src/nsLocalMailFolder.cpp
  mailnews/local/src/nsLocalUndoTxn.cpp
  mailnews/local/src/nsLocalUndoTxn.h


git-svn-id: svn://10.0.0.236/trunk@89126 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-09 14:23:59 +00:00
warren%netscape.com
a8b9664a8c Bug 47207. Backing out logging/PRINTF changes until we can fix stopwatch.h, introduce double parens, etc.
git-svn-id: svn://10.0.0.236/trunk@81967 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-28 22:17:53 +00:00
warren%netscape.com
c6b67eceeb Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson
git-svn-id: svn://10.0.0.236/trunk@81885 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-27 22:43:51 +00:00
mjudge%netscape.com
2fc6190bef small but pervasive change to make nsIDOMSelection an xpidl interface. also broke it into 2 interfaces, nsISelection and nsISelectionPrivate. moved nsIDOMSelectionListener also to xpidl. these new idl files live in layout/base/public. r=sfraser, r=anthonyd bug 48575
git-svn-id: svn://10.0.0.236/trunk@79118 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-14 11:45:01 +00:00
anthonyd%netscape.com
57bfacee97 fix for regression, bug#45477
cant insert hrules, images, etc...
r=brade, a=granrose


git-svn-id: svn://10.0.0.236/trunk@74254 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-14 18:38:24 +00:00
mjudge%netscape.com
1f23cf0495 anthonyd: r=mjudge bug 39919 letting DOM level 2 stuff work for the editor. eliminating createelementNS and using the factory instead.
git-svn-id: svn://10.0.0.236/trunk@74199 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-13 23:15:41 +00:00
rbs%maths.uq.edu.au
de23cc3486 Change invalid REC-html40 to correct XHTML namespace. b:7834. a:ekrock@netscape.com
git-svn-id: svn://10.0.0.236/trunk@72300 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-15 09:54:41 +00:00
mjudge%netscape.com
9ac751705d bug=34896 changing use of CreateElement to CreateElementNS. this was necessary outside of ender-lite also. good change. r=jfrancis a=beppe
git-svn-id: svn://10.0.0.236/trunk@71679 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-07 01:18:12 +00:00
warren%netscape.com
cc5d426fbe Renaming nsIAllocator to nsIMemory (and nsAllocator to nsMemory). API cleanup/freeze. Bug #18433
git-svn-id: svn://10.0.0.236/trunk@71450 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-03 09:46:12 +00:00
scc%netscape.com
4f0c5e3591 making string conversions explicit
git-svn-id: svn://10.0.0.236/trunk@66273 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-18 07:44:58 +00:00
jfrancis%netscape.com
13c14e71dc improved paste performance in editor (WIP) (bug 28783)
set/remove inline stlye rewrite (lots of bug #s)


git-svn-id: svn://10.0.0.236/trunk@63943 18797224-902f-48f8-a5cc-f745e15eee43
2000-03-24 00:13:30 +00:00
akkana%netscape.com
5bf44a084f 22655: add API to allow specifying charset when inserting/quoting html. r=rhp
16015: Add API and implementation for delete-to-beginning (^U). r=slamm,rhp
490: Insert formatting newlines when inserting new nodes. r=rhp


git-svn-id: svn://10.0.0.236/trunk@56743 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-04 20:38:12 +00:00
jfrancis%netscape.com
11faed23b2 Fix for bug 21346.
This is actually a major reworking of how the low level editor txns perturb selection.  There is a mode now for telling the txns not to disturb the selection.  There is also a fix for unlisting lists (sometimes list items got merged unintentionally when unlisting).


git-svn-id: svn://10.0.0.236/trunk@56714 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-04 03:09:41 +00:00
dmose%mozilla.org
0efb7c174c updated xPL license boilerplate to v1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52910 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 03:43:54 +00:00
buster%netscape.com
a8ec8337df some extremely minor cleanup of bugs found by ftang. Thanks, frank.
git-svn-id: svn://10.0.0.236/trunk@51036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:59:19 +00:00
brade%netscape.com
7e0421e57c allow for txn to have id/string for get/set
git-svn-id: svn://10.0.0.236/trunk@48658 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-21 22:31:27 +00:00
akkana%netscape.com
84288de56c Better debug prints: tell which tag we're creating
git-svn-id: svn://10.0.0.236/trunk@46852 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-10 22:34:18 +00:00
buster%netscape.com
4c4a0c3a0e removed static constructors, since they're illegal in our system
git-svn-id: svn://10.0.0.236/trunk@45192 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-30 22:12:11 +00:00
buster%netscape.com
d1193affa0 Fixed a ton of errors where we were not handling error results correctly.
Added some comments of the form "// XXX: ERROR_HANDLING <explanation>"
wherever I saw a potential error but wasn't 100% sure of the intention of the code.
Fixed a few bugs along the way.


git-svn-id: svn://10.0.0.236/trunk@43590 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-19 13:30:48 +00:00
sfraser%netscape.com
4dd92661ce Landing editor API changes. Removed nsITextEditor and nsTextEditor, split interfaces into more, non-overlapping interfaces, and other general cleanup.
git-svn-id: svn://10.0.0.236/trunk@42725 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-09 01:37:50 +00:00
jfrancis%netscape.com
8a52f1dd60 default to setting selection _after_ a created element
git-svn-id: svn://10.0.0.236/trunk@41047 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-25 09:25:02 +00:00
mjudge%netscape.com
329d39ba11 massive checkin for selection. adjusting nsIDOMSelection api and nsIFrameSelection. many "small" changes. this is not as bad as it looks. layout will not be affected other than "getter" calls for selection. and all consumers of selection should be in good shape.
git-svn-id: svn://10.0.0.236/trunk@39971 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-18 02:27:19 +00:00
mjudge%netscape.com
757f22388f checkin for carpool for multiple seleciton/ime selection and api changes
git-svn-id: svn://10.0.0.236/trunk@39542 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-15 18:19:20 +00:00
buster%netscape.com
d94e56698f fixed warnings
git-svn-id: svn://10.0.0.236/trunk@37179 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-28 13:44:40 +00:00
sfraser%netscape.com
a6a9b7ff1b Changed transactions not to have owning pointers to the Editor.
git-svn-id: svn://10.0.0.236/trunk@33042 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-28 00:13:02 +00:00
kin%netscape.com
ee983116d2 Changed all occurrences of GetUndoString() and GetRedoString() to accept nsString *.
git-svn-id: svn://10.0.0.236/trunk@32955 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-27 20:50:52 +00:00
buster%netscape.com
9a004fa0f0 1. block transformation infrastructure is now in place. We can go ahead and implement interesting
features like set paragraph style, set list type, indent, etc.  I'm sure there's holes in my
implementation that these high level features will make obvious.

2. I've factored a lot of utility methods from several modules into nsEditor as public static methods.
This makes them easily accessable to all, and will help Joe and I remove redundant methods.

3. I changed the HTML tags to lower case, and made all string compares case-insensitive.  No, this
isn't quite the right thing to do, but we don't have atoms from layout yet.  The Right Thing is for us
to reuse those atoms.


git-svn-id: svn://10.0.0.236/trunk@30367 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-05 04:05:19 +00:00
buster%netscape.com
9d9d079eda *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@28243 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-20 17:39:23 +00:00
buster%netscape.com
64e11a9d2f vastly improved RemoveTextProperty
turned off debug output


git-svn-id: svn://10.0.0.236/trunk@27115 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-11 22:55:40 +00:00
buster%netscape.com
0fe8e1324d As a reminder, we decided to do this based strictly content. Some support for style-based text properties is written, but not used
anywhere any more.

* Cleaned up split and join undo/redo.
* Added TypeInState, a data struct that remembers things about text properties for collapsed selections, so you can type
* Ctrl-B with an insertion point and the next character will be bold.
* Added all the logic to handle inline vs. block elements when setting text properties.
* Added some support for italic and underline as well.  Adding these things is pretty easy now.  Ctrl-B, Ctrl-I, Ctrl-U for testing bold, italic, underline.
* Added all the logic to make sure we only add style tags where they're needed, so you should never get the same style tag nested within itself, except as needed for block elements.
* Added methods for testing a node to see if a particular style is set.  This isn't 100% done yet, but with very little work we could have toolbar buttons that respond to selection changed notification that show the state of bold, italic, underline, etc. in real time.  Supports tri-state:  whole selection is bold, some of selection is bold, none of selection is bold, ...
* Fully undoable and redoable.
* Added some debug printfs to transactions and editors.  all controlled by a gNoisy static in each module.  helps me track down undo/redo problems.  if the output bugs people enough, I'll shut it off and re-enable it in my local tree.

Noticably missing:  make un-bold, make un-italic, etc.  This is coming soon.


git-svn-id: svn://10.0.0.236/trunk@25869 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-01 17:58:07 +00:00
buster%netscape.com
3475d199f3 fixed a small bug. mRefNode may be nsnull.
git-svn-id: svn://10.0.0.236/trunk@23835 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:27:48 +00:00
buster%netscape.com
f076cbe10e creation of text nodes now supported
git-svn-id: svn://10.0.0.236/trunk@23546 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:51:55 +00:00
mjudge%netscape.com
86f2920385 fixes for selection code, batching at correct point
git-svn-id: svn://10.0.0.236/trunk@22674 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:51:59 +00:00
cmanske%netscape.com
202c5b89dc Implemented nsHTMLEditor. Changed prototypes to be use NS_IMETHOD and NS_IMETHODIMP. Started table editing transactions
git-svn-id: svn://10.0.0.236/trunk@22534 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 05:30:53 +00:00
buster%netscape.com
7218a4a579 added InsertElementTxn
added nsEditProperty
beginning of implementation for SetTextProperties.  Currently, it only works if the selection is entirely within a single text node.  Currently only
supports bold and italic (mapped to ctrl-b and ctrl-i for testing purposes.)
changed a bunch of interfaces to make things easier, like CreateElement now returns (as an out-param) the element created.


git-svn-id: svn://10.0.0.236/trunk@21760 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-24 17:24:37 +00:00
buster%netscape.com
fb7ad5c58c caught up to new ScrollIntoView changes.
most transactions now properly set selection after modifying content, for Do, Undo, Redo.
lots of cleanup and minor bug fixes.


git-svn-id: svn://10.0.0.236/trunk@21466 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-22 15:53:31 +00:00
mcafee%netscape.com
92753a46b3 Solaris: adding do_QueryInterface() wrappers to finish scc's nsCOMPtr carpool. a=scc
git-svn-id: svn://10.0.0.236/trunk@21297 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 11:30:31 +00:00
buster%netscape.com
f62022c72f Highlights:
updated to new nsCOMPtr usage
nsTextEditor::InsertBreak() implemented
  splits the text node at the caret (deletes any extended selection to force a collapsed selection.)
  inserts a <BR> which I assume we'll convert to a CR when we write to a text stream.
  undo and redo work, except for the bug noted below

More stuff:
interface cleanup
strategic debugging code added
delete selection txn sets the collapses the selection...this is just a placeholder, but I needed it for undo/redo of InsertBreak.
join and split now work for text nodes as well as interior nodes


git-svn-id: svn://10.0.0.236/trunk@21009 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 19:42:29 +00:00
buster%netscape.com
f1bacd2e07 made GetIsTransient return false by default, so most transactions don't need to implement GetIsTransient
made delete and backspace do the right thing (testing hacks removed)


git-svn-id: svn://10.0.0.236/trunk@18304 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-22 15:40:31 +00:00
buster%netscape.com
b48e2caf7c * added TransactionFactory. Editor no longer allocates its own transactions. This gives us an oppurtunity for a recycler.
* added DeleteSelection to editor.  Doesn't work very well yet because selection is giving me random offsets into text content.
* lots of work in the various transactions.


git-svn-id: svn://10.0.0.236/trunk@18122 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-21 01:51:09 +00:00
buster%netscape.com
dceac9452d added DeleteElementTxn and DeleteRangeTxn, and added merging of text insertions.
added some better error checking on all transactions.


git-svn-id: svn://10.0.0.236/trunk@17740 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-14 18:02:45 +00:00
buster%netscape.com
8a19fb26be shuffled around the responsibilities of core editing objects.
The key listener is now mostly a mapper of key events to editor actions.  Soon, this should be 100% true.
The editor builds transactions that are themselves intelligent. The editor makes very few DOM calls itself.
It relies on the transactions to do most of the actual editing.


git-svn-id: svn://10.0.0.236/trunk@17518 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-11 22:47:23 +00:00
buster%netscape.com
29389f0fcd fixed an uninitialized pointer problem
ctrl-ins appends an HR to the BODY


git-svn-id: svn://10.0.0.236/trunk@17354 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-08 01:41:34 +00:00
buster%netscape.com
136be95fe1 implemented do and undo for CreateElement
the test is INS key, it adds an HR


git-svn-id: svn://10.0.0.236/trunk@17353 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-08 01:30:53 +00:00
buster%netscape.com
32c39f7e29 create element transaction WIP
git-svn-id: svn://10.0.0.236/trunk@17331 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-07 22:36:23 +00:00