49 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
mjudge%netscape.com
aacbb20c68 massive change to stop the editor fromknowing about nsIPresShell or nsIDocument
git-svn-id: svn://10.0.0.236/trunk@67485 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-28 06:20:36 +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
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
1e0b48570c fixed some space leaks reported by kipp. no bug #, r=tague
added some assertions and error checking to nsEditor::Do, no bug #, r=kin
fixed bug 14898 (implemented type-in state for any context), r=jfrancis


git-svn-id: svn://10.0.0.236/trunk@50004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-06 20:27:41 +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
sfraser%netscape.com
59455396ec Use nsAutoStrings where appropriate
git-svn-id: svn://10.0.0.236/trunk@47453 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-14 23:40:16 +00:00
jfrancis%netscape.com
2a60fccebc making nsPresShell and nsDocument support weak references; using weak references to docs and pres shells within the editor
git-svn-id: svn://10.0.0.236/trunk@44483 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-25 10:51:55 +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
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
buster%netscape.com
6382cd2eea replaced IID's with CID's where they were appropriate, and removed lots of
NS_DEFINE_IID macros in favor of GetCID() wherever I could.
plus some minor bug fixes.


git-svn-id: svn://10.0.0.236/trunk@39546 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-15 19:13:46 +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
cmanske%netscape.com
79fd9050ea Generic message dialog, fix insert element-related bugs, initial personal dictionary dialog, other editor bugs
git-svn-id: svn://10.0.0.236/trunk@39268 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-14 15:24:33 +00:00
tague%netscape.com
ea708a16a8 Added clause and selection support for Input Methods. Fixes bug #8639, #8459, #6989, #7824
git-svn-id: svn://10.0.0.236/trunk@37435 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-29 20:31:22 +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
buster%netscape.com
d88fa6aa8c fixed illegal use of nsCOMPtr
git-svn-id: svn://10.0.0.236/trunk@36763 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-24 23:33:18 +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
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
baaca59f79 implemented simple cases of RemoveTextProperty. other cases are no-op'd now.
added aFirst out param to GetTextProperty, so the caller can know if the first character has the property in the case of aAny=true and aAll=false.
fixed a bunch of places where result was being used incorrectly as a return val from do_QueryInterface
some minor undo/redo fixes to split and join of interior nodes.


git-svn-id: svn://10.0.0.236/trunk@26218 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-04 18:01:35 +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
ef5f3265cc added PlaceholderTxn. This is an aggregate transaction that sits on the undo stack
and merges in subsequent transactions indiscriminately until it's told to stop.
It also gives the last transaction in its child list a chance to merge the
next transaction.
All this is in support of complex transactions that result in text insertion
being able to collapse into a single undoable event.
Also improved tracking of bogus content node used when document is empty.


git-svn-id: svn://10.0.0.236/trunk@24151 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:57:32 +00:00
cmanske%netscape.com
6987407539 Changed editor classes to inherited model. Fixed lots of destructor warnings.
git-svn-id: svn://10.0.0.236/trunk@22944 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:05:35 +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
scc%netscape.com
84d4e393bc fixed for nsCOMPtr: no construction or assignment from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22609 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:27:46 +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
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
mjudge%netscape.com
25715df9ea adding batching for selection.
git-svn-id: svn://10.0.0.236/trunk@21355 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 23:41:49 +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
danm%netscape.com
9d9fe04c5a fixing compilation problems with new nsCOMPtr. part of the carpool.
git-svn-id: svn://10.0.0.236/trunk@20899 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 06:18:11 +00:00
mjudge%netscape.com
935f3ddcd6 new modifications to nsCOMPtr to explicitly change to QueryInterface
git-svn-id: svn://10.0.0.236/trunk@20849 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 01:59:56 +00:00
buster%netscape.com
72d2391591 merges text insertions again, based on new aggregate insert txn
git-svn-id: svn://10.0.0.236/trunk@20729 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-15 18:24:58 +00:00
buster%netscape.com
6d04acb923 * the viewer test app now instantiates an nsITextEditor via nsRepository for "Editor mode"
* the TxnMgr is invoked by the editor via nsRepository
* editor.h|cpp have been renamed nsEditor.h|cpp for consistency
* editorInterfaces.h|cpp have been renamed nsEditorEventListeners.c|hpp
* added nsITextEditor.h, nsTextEditor.h|cpp.  The text editor is a placeholder for the rules unique to text
editing.  It invokes the nsIEditor to do core editing operations.
* reworked nsIEditor and related interfaces as per emerging design.
* nsEditor::BeginTransaction and EndTransaction call nsTransactionManager::BeginBatch and EndBatch.


git-svn-id: svn://10.0.0.236/trunk@20562 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 17:18:58 +00:00
akkana%netscape.com
0ebe0a4652 Rename nsISelection to nsIFrameSelection
git-svn-id: svn://10.0.0.236/trunk@20457 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-11 23:12:28 +00:00
akkana%netscape.com
52b18e6064 Implement a new interface, nsIDOMSelection, intended to become the
external interface for selection (to be IDL-ified later).

Fix some editor bugs:
- Advance the cursor on text insert (so text is inserted in the right order)
- Make DeleteSelection in the editor call the actual selection
- Make DeleteSelection update the frames' notion of the selection


git-svn-id: svn://10.0.0.236/trunk@19029 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-29 18:57:56 +00:00
buster%netscape.com
956232ee80 put in crude support for aggregating type-ins across selection changes.
this needs to get beefed up to handle offsets within elements, which we'll
do as soon as selection is set properly following an insertion.


git-svn-id: svn://10.0.0.236/trunk@18931 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-28 19:00:14 +00:00
buster%netscape.com
f2aea9aa2d fixed a minor problem with merging type-in transactions.
git-svn-id: svn://10.0.0.236/trunk@18925 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-28 17:19:24 +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
mjudge%netscape.com
da1cc58b72 fixing build bustage
git-svn-id: svn://10.0.0.236/trunk@18253 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-22 03:18:51 +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
sfraser%netscape.com
42d6e74fbe Reinstate buster's changes, with a fix for the nsCOMPtr problem.
git-svn-id: svn://10.0.0.236/trunk@17796 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-15 00:03:41 +00:00
buster%netscape.com
045c82cdbf backed out Merge functionality because it doesn't compile on Mac.
git-svn-id: svn://10.0.0.236/trunk@17752 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-14 21:52:08 +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
2659c27999 use base class Redo
git-svn-id: svn://10.0.0.236/trunk@17314 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-07 17:57:57 +00:00
buster%netscape.com
9ead1505eb support for inserting text
git-svn-id: svn://10.0.0.236/trunk@17280 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-07 01:02:32 +00:00